Improve cjdns tools
This commit is contained in:
parent
e19bc976a5
commit
95bb0d0693
|
@ -2284,23 +2284,38 @@ function mesh_cjdns_tools {
|
||||||
if [ ! -f ~/.bashrc ]; then
|
if [ ! -f ~/.bashrc ]; then
|
||||||
touch ~/.bashrc
|
touch ~/.bashrc
|
||||||
fi
|
fi
|
||||||
export GOPATH=$HOME/projects/go
|
|
||||||
|
export GOPATH=/home/git/go
|
||||||
|
if [ ! -d /home/git ]; then
|
||||||
|
# add a gogs user account
|
||||||
|
adduser --disabled-login --gecos 'Gogs' git
|
||||||
|
|
||||||
|
# install Go
|
||||||
|
if ! grep -q "export GOPATH=/home/git/go" ~/.bashrc; then
|
||||||
|
echo 'export GOPATH=/home/git/go' >> ~/.bashrc
|
||||||
|
echo 'systemctl set-environment GOPATH=/home/git/go' >> ~/.bashrc
|
||||||
|
fi
|
||||||
|
if [ ! -d $GOPATH ]; then
|
||||||
|
mkdir -p $GOPATH
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if ! grep -q "export GOPATH=" ~/.bashrc; then
|
if ! grep -q "export GOPATH=" ~/.bashrc; then
|
||||||
echo 'export GOPATH=$HOME/projects/go' >> ~/.bashrc
|
echo "export GOPATH=$GOPATH" >> ~/.bashrc
|
||||||
fi
|
fi
|
||||||
if ! grep -q "export PATH=$PATH:$HOME/projects/go/bin" ~/.bashrc; then
|
expected_go_path='export PATH=$PATH:'${GOPATH}'/bin'
|
||||||
export PATH=$PATH:$HOME/projects/go/bin
|
if ! grep -q "$expected_go_path" ~/.bashrc; then
|
||||||
echo 'export PATH=$PATH:$HOME/projects/go/bin' >> ~/.bashrc
|
export PATH=$PATH:${GOPATH}/bin
|
||||||
|
echo "$expected_go_path" >> ~/.bashrc
|
||||||
fi
|
fi
|
||||||
export GOPATH=$HOME/projects/go
|
export PATH=$PATH:$GOPATH/bin
|
||||||
export PATH=$PATH:$HOME/projects/go/bin
|
CJDCMD_REPO2=$(echo "$CJDCMD_REPO" | sed 's|https://||g')
|
||||||
CJDCMD_REPO2=$(echo "$CJDCMD_REPO" | sed 's|https://||g')
|
|
||||||
go get $CJDCMD_REPO2
|
go get $CJDCMD_REPO2
|
||||||
if [ ! -f $HOME/projects/go/bin/cjdcmd ]; then
|
if [ ! -f $GOPATH/bin/cjdcmd ]; then
|
||||||
echo $'cjdcmd was not compiled. Check your golang installation'
|
echo $'cjdcmd was not compiled. Check your golang installation'
|
||||||
exit 7439
|
exit 7439
|
||||||
fi
|
fi
|
||||||
cp $HOME/projects/go/bin/cjdcmd /usr/bin
|
cp $GOPATH/bin/cjdcmd /usr/bin
|
||||||
|
|
||||||
# initialise from the cjdns config
|
# initialise from the cjdns config
|
||||||
/usr/bin/cjdcmd cjdnsadmin -file /etc/cjdns/cjdroute.conf
|
/usr/bin/cjdcmd cjdnsadmin -file /etc/cjdns/cjdroute.conf
|
||||||
|
@ -6650,7 +6665,7 @@ function install_gogs {
|
||||||
if [ ! -d $GOPATH ]; then
|
if [ ! -d $GOPATH ]; then
|
||||||
mkdir -p $GOPATH
|
mkdir -p $GOPATH
|
||||||
fi
|
fi
|
||||||
GO_PACKAGE_MANAGER_REPO2=$(echo "$GO_PACKAGE_MANAGER_REPO" | sed 's|https://||g')
|
GO_PACKAGE_MANAGER_REPO2=$(echo "$GO_PACKAGE_MANAGER_REPO" | sed 's|https://||g')
|
||||||
go get -u $GO_PACKAGE_MANAGER_REPO2
|
go get -u $GO_PACKAGE_MANAGER_REPO2
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
exit 479832
|
exit 479832
|
||||||
|
@ -9615,7 +9630,7 @@ function install_ipfs {
|
||||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IPFS_GO_REPO2=$(echo "$IPFS_GO_REPO" | sed 's|https://||g')
|
IPFS_GO_REPO2=$(echo "$IPFS_GO_REPO" | sed 's|https://||g')
|
||||||
go get -u ${IPFS_GO_REPO2}/cmd/ipfs
|
go get -u ${IPFS_GO_REPO2}/cmd/ipfs
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
exit 8242
|
exit 8242
|
||||||
|
|
Loading…
Reference in New Issue