procd: service: pass all arguments to service
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>
Sun, 30 Oct 2022 14:56:14 +0000 (15:56 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 13 Nov 2022 20:51:10 +0000 (21:51 +0100)
Passing all arguments to /etc/init.d/$service restores the
behaviour of openwrt 21.02. This is relevant for services
such as etherwake which take more then one argument, e.g.:
"service etherwake start <list of devices to wake>"

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
package/system/procd/files/service

index 1ceacfe5add6c5054303715ebd4c0b5e6c72af1d..0ca70580417437e938bf21991e5e557001e86c6b 100644 (file)
@@ -2,17 +2,17 @@
 
 main() {
        local service="$1"
-       local cmd="$2"
+       shift
 
        local boot status
 
        if [ -f "/etc/init.d/${service}" ]; then
-               /etc/init.d/"${service}" "${cmd}"
+               /etc/init.d/"${service}" "$@"
                exit "$?"
        fi
 
        if [ -n "$service" ]; then
-               echo "Service \"$1\" not found:"
+               echo "Service \"$service\" not found:"
                exit 1
        fi