Skip to content

Instantly share code, notes, and snippets.

@mildred

mildred/bootstrap-geard.sh

Last active Aug 29, 2015
Embed
What would you like to do?
Install geard from source
#!/bin/sh
#See: https://aur.archlinux.org/packages/ge/geard-git/PKGBUILD
set -e
: ${PREFIX:=/usr/local}
mkdir -p $PREFIX/src/geard.go
cd $PREFIX/src/geard.go
export GOPATH="$PWD"
mkdir -p src/github.com/openshift
git clone https://github.com/openshift/geard.git src/github.com/openshift/geard || true
src/github.com/openshift/geard/contrib/build -n -l
sed "s:/usr/bin:$PREFIX/bin:g" src/github.com/openshift/geard/contrib/geard.service >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##*/}
#done
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
fi
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.