Skip to content

Instantly share code, notes, and snippets.

@topjor
Created February 7, 2019 20:44
Show Gist options
  • Save topjor/de2344fb39187adb13f455a42aa5c6a2 to your computer and use it in GitHub Desktop.
Save topjor/de2344fb39187adb13f455a42aa5c6a2 to your computer and use it in GitHub Desktop.
Wireguard firmware sustain script
#!/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