From 1f649f470a922208f8e2bf60f7f0f4d9ebd2c7b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Jun 2021 00:18:12 +0200 Subject: [PATCH] - sysvinit: small changes to service script --- package/sysvinit/files/service | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/package/sysvinit/files/service b/package/sysvinit/files/service index adfd8196..4381db5b 100644 --- a/package/sysvinit/files/service +++ b/package/sysvinit/files/service @@ -15,6 +15,12 @@ usage() { exit 1 } +get_services() { + for i in /etc/init.d/[^SK]* /var/etc/init.d/[^SK]*; do + echo "${i##*/}" + done | sort -u | grep -v '^\(functions\|globals\|rc\|rcK\|rcS\|start_neutrino\|\[\^SK\]\*\)$' +} + test -z "$ACTION" && usage; for i in /etc/init.d/$SERVICE /var/etc/init.d/$SERVICE; do @@ -26,9 +32,6 @@ for i in /etc/init.d/$SERVICE /var/etc/init.d/$SERVICE; do done echo "$SERVICE not found in /etc/init.d/ and /var/etc/init.d/" -SERVICES=$(for i in /etc/init.d/[^SK]* /var/etc/init.d/[^SK]*; do - echo "${i##*/}"; - done | sort -u | grep -v '^\(functions\|globals\|rc\|rcK\|rcS\|start_neutrino\|\[\^SK\]\*\)$') echo "available services:" -echo $SERVICES | xargs -n 1 echo " " +echo $(get_services) | xargs -n 1 echo " " exit 1