mirror of https://github.com/Revertron/Alfis
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
658 B
Bash
21 lines
658 B
Bash
#!/opt/bin/bash
|
|
|
|
# ALFIS upgrade script for Keenetic routers with Entware
|
|
|
|
json=$(curl -s "https://api.github.com/repos/Revertron/Alfis/releases/latest")
|
|
upstreamver=$(echo "$json" | jq -r ".tag_name")
|
|
|
|
curver=$(alfis -v | cut -c7-25)
|
|
|
|
changed=$(diff <(echo "$curver") <(echo "$upstreamver"))
|
|
|
|
if [ "$changed" != "" ]
|
|
then
|
|
echo "Upgrading from $curver to $upstreamver"
|
|
/opt/etc/init.d/S98alfis stop
|
|
wget https://github.com/Revertron/Alfis/releases/download/$upstreamver/alfis-linux-mipsel-$upstreamver-nogui -O /opt/bin/alfis
|
|
chmod +x /opt/bin/alfis
|
|
/opt/etc/init.d/S98alfis start
|
|
else
|
|
echo "No need to upgrade, $curver is the current version"
|
|
fi |