diff --git a/README.md b/README.md index 8f307fc..76e5298 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bfd397624cdf4803a465d4ae1530e7fe)](https://www.codacy.com/app/jackyaz/scMerlin?utm_source=github.com&utm_medium=referral&utm_content=jackyaz/scMerlin&utm_campaign=Badge_Grade) ![Shellcheck](https://github.com/jackyaz/scMerlin/actions/workflows/shellcheck.yml/badge.svg) -## v2.4.1 -### Updated on 2022-01-05 +## v2.4.2 +### Updated on 2024-03-12 ## About scMerlin allows you to easily control the most common services/scripts on your router. scMerlin also augments your router's WebUI with a Sitemap and dynamic submenus for the main left menu of Asuswrt-Merlin. diff --git a/scmerlin.sh b/scmerlin.sh index 40c21bc..dd31307 100644 --- a/scmerlin.sh +++ b/scmerlin.sh @@ -26,9 +26,9 @@ ### Start of script variables ### readonly SCRIPT_NAME="scMerlin" readonly SCRIPT_NAME_LOWER="$(echo "$SCRIPT_NAME" | tr 'A-Z' 'a-z' | sed 's/d//')" -readonly SCM_VERSION="v2.4.1" -readonly SCRIPT_VERSION="v2.4.1" -SCRIPT_BRANCH="master" +readonly SCM_VERSION="v2.4.2" +readonly SCRIPT_VERSION="v2.4.2" +SCRIPT_BRANCH="develop" SCRIPT_REPO="https://jackyaz.io/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME_LOWER.d" readonly SCRIPT_WEBPAGE_DIR="$(readlink /www/user)" @@ -514,6 +514,10 @@ Auto_Startup(){ fi fi if [ -f /jffs/scripts/services-start ]; then + ## Clean up erroneous entries ## + grep -iq '# '"${SCRIPT_NAME}[$]$" /jffs/scripts/services-start && \ + sed -i -e '/# '"${SCRIPT_NAME}[$]$"'/d' /jffs/scripts/services-start + STARTUPLINECOUNT=$(grep -i -c '# '"$SCRIPT_NAME$" /jffs/scripts/services-start) STARTUPLINECOUNTEX=$(grep -i -cx "/jffs/scripts/$SCRIPT_NAME_LOWER startup"' & # '"$SCRIPT_NAME$" /jffs/scripts/services-start) @@ -540,6 +544,10 @@ Auto_Startup(){ fi fi if [ -f /jffs/scripts/services-start ]; then + ## Clean up erroneous entries ## + grep -iq '# '"${SCRIPT_NAME}[$]$" /jffs/scripts/services-start && \ + sed -i -e '/# '"${SCRIPT_NAME}[$]$"'/d' /jffs/scripts/services-start + STARTUPLINECOUNT=$(grep -i -c '# '"$SCRIPT_NAME$" /jffs/scripts/services-start) if [ "$STARTUPLINECOUNT" -gt 0 ]; then