Improve cjdns tools
This commit is contained in:
parent
e19bc976a5
commit
95bb0d0693
|
@ -2284,23 +2284,38 @@ function mesh_cjdns_tools {
|
|||
if [ ! -f ~/.bashrc ]; then
|
||||
touch ~/.bashrc
|
||||
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
|
||||
echo 'export GOPATH=$HOME/projects/go' >> ~/.bashrc
|
||||
echo "export GOPATH=$GOPATH" >> ~/.bashrc
|
||||
fi
|
||||
if ! grep -q "export PATH=$PATH:$HOME/projects/go/bin" ~/.bashrc; then
|
||||
export PATH=$PATH:$HOME/projects/go/bin
|
||||
echo 'export PATH=$PATH:$HOME/projects/go/bin' >> ~/.bashrc
|
||||
expected_go_path='export PATH=$PATH:'${GOPATH}'/bin'
|
||||
if ! grep -q "$expected_go_path" ~/.bashrc; then
|
||||
export PATH=$PATH:${GOPATH}/bin
|
||||
echo "$expected_go_path" >> ~/.bashrc
|
||||
fi
|
||||
export GOPATH=$HOME/projects/go
|
||||
export PATH=$PATH:$HOME/projects/go/bin
|
||||
export PATH=$PATH:$GOPATH/bin
|
||||
CJDCMD_REPO2=$(echo "$CJDCMD_REPO" | sed 's|https://||g')
|
||||
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'
|
||||
exit 7439
|
||||
fi
|
||||
cp $HOME/projects/go/bin/cjdcmd /usr/bin
|
||||
cp $GOPATH/bin/cjdcmd /usr/bin
|
||||
|
||||
# initialise from the cjdns config
|
||||
/usr/bin/cjdcmd cjdnsadmin -file /etc/cjdns/cjdroute.conf
|
||||
|
|
Loading…
Reference in New Issue