Last active
November 26, 2019 08:46
-
-
Save zaftzaft/72ef2274abab5084658eb51c01966d85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v=2.10.0 | |
version=v$v | |
file=gobgp_${v}_linux_amd64 | |
service=gobgpd | |
wget https://github.com/osrg/gobgp/releases/download/${version}/${file}.tar.gz \ | |
-O /tmp/$file.tar.gz | |
systemctl is-enabled $service | |
if [ $? -eq 0 ]; then | |
systemctl stop $service | |
fi | |
cd /tmp | |
tar xvf /tmp/$file.tar.gz | |
install -Dm 755 /tmp/gobgp /usr/bin/ | |
install -Dm 755 /tmp/gobgpd /usr/bin/ | |
touch /etc/gobgpd.yml | |
if [ -d /usr/lib/systemd/system/ ]; then | |
unit_dir=/usr/lib/systemd/system | |
else | |
unit_dir=/etc/systemd/system | |
fi | |
tee $unit_dir/${service}.service << EOS | |
[Unit] | |
Description=gobgpd | |
[Service] | |
Restart=always | |
ExecStart=/usr/bin/gobgpd -f /etc/gobgpd.yml -t yaml | |
[Install] | |
WantedBy=default.target | |
EOS | |
systemctl daemon-reload | |
#systemctl enable $service | |
#systemctl start $service | |
cd - | |
echo edit /etc/gobgpd.yml and enable systemd gobgpd.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment