Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Install geard from source
set -e
: ${PREFIX:=/usr/local}
mkdir -p $PREFIX/src/geard.go
cd $PREFIX/src/geard.go
export GOPATH="$PWD"
mkdir -p src/
git clone src/ || true
src/ -n -l
sed "s:/usr/bin:$PREFIX/bin:g" src/ >geard.service
set -x
install -d $PREFIX/stow/geard/lib/systemd/system/ $PREFIX/stow/geard/bin/
#for binfile in bin/*; do
# install -Dm755 $binfile $PREFIX/stow/geard/bin/${binfile##*/}
install -Dm755 bin/gear $PREFIX/stow/geard/bin/gear
install -Dm755 bin/switchns $PREFIX/stow/geard/bin/switchns
install -Dm755 bin/sti $PREFIX/stow/geard/bin/sti
install -Dm755 bin/gear-auth-keys-command $PREFIX/stow/geard/sbin/gear-auth-keys-command
install -Dm644 geard.service $PREFIX/stow/geard/lib/systemd/system/
if [ -e /bin/systemctl ] && ! [ -e /usr/bin/systemctl ]; then
ln -sf /bin/systemctl $PREFIX/stow/geard/bin/systemctl
set +x
find $PREFIX/stow/geard
cd $PREFIX/stow
stow -R geard
echo "systemctl enable geard.service"
echo "systemctl start geard.service"
echo "systemctl status geard.service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.