From 9b6a6f17188f7170651440a91c8ed71a3fa805cf Mon Sep 17 00:00:00 2001 From: Revertron Date: Fri, 23 Apr 2021 23:09:39 +0200 Subject: [PATCH] Added and updated some configs. --- .github/workflows/rust_parallel_release.yml | 6 +++++- contrib/router/S98alfis | 13 +++++++++++++ contrib/router/upgrade_alfis.sh | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 contrib/router/S98alfis create mode 100644 contrib/router/upgrade_alfis.sh diff --git a/.github/workflows/rust_parallel_release.yml b/.github/workflows/rust_parallel_release.yml index ae4904c..099a86b 100644 --- a/.github/workflows/rust_parallel_release.yml +++ b/.github/workflows/rust_parallel_release.yml @@ -40,8 +40,12 @@ jobs: tag_name: ${{ env.VERSION }} release_name: ${{ env.VERSION }} body: | - ## A new version + ## New + * Added new features. + ## Bug Fixes & Improvements * Various fixes and stability improvements. + ## Documentation & others + * Updated documentation. draft: true prerelease: false diff --git a/contrib/router/S98alfis b/contrib/router/S98alfis new file mode 100644 index 0000000..e26d578 --- /dev/null +++ b/contrib/router/S98alfis @@ -0,0 +1,13 @@ +#!/bin/sh + +# This is the "Service" file for ALFIS in OPKG environment +# Usually lives in /opt/etc/init.d/ directory + +ENABLED=yes +PROCS=alfis +ARGS="-d -c /opt/etc/alfis.conf -w /opt/var/lib/alfis/ -l /opt/var/log/alfis.log" +PREARGS="" +DESC=$PROCS +PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +. /opt/etc/init.d/rc.func diff --git a/contrib/router/upgrade_alfis.sh b/contrib/router/upgrade_alfis.sh new file mode 100644 index 0000000..404a99c --- /dev/null +++ b/contrib/router/upgrade_alfis.sh @@ -0,0 +1,21 @@ +#!/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 \ No newline at end of file