Created
February 7, 2019 20:44
-
-
Save topjor/de2344fb39187adb13f455a42aa5c6a2 to your computer and use it in GitHub Desktop.
Wireguard firmware sustain script
This file contains hidden or 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
#!/bin/bash -e | |
BOARD=e300 | |
if [ ! $(dpkg-query --show wireguard) ]; then | |
tag=$(curl "https://api.github.com/repos/Lochnair/vyatta-wireguard/releases" | jq -r '.[0].tag_name') | |
deb_url="https://github.com/Lochnair/vyatta-wireguard/releases/download/$tag/wireguard-$BOARD-$tag-1.deb" | |
curl -L -o "/tmp/wireguard-$BOARD-$tag.deb" "$deb_url" | |
dpkg -i "/tmp/wireguard-$BOARD-$tag.deb" | |
rm "/tmp/wireguard-$BOARD-$tag.deb" | |
source /opt/vyatta/etc/functions/script-template | |
configure | |
#load - direct command trigger because load seems to not be defined in script-template | |
/opt/vyatta/sbin/vyatta-load-config.pl | |
commit | |
exit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment