__start_on_boot type: add support for OpenWRT

Signed-off-by: Giel van Schijndel <giel+cdist@mortis.eu>
This commit is contained in:
Giel van Schijndel 2012-02-21 15:48:39 +01:00
parent 566bfda6d2
commit 12d2c6c199
2 changed files with 12 additions and 1 deletions

View file

@ -44,7 +44,7 @@ case "$os" in
done
;;
debian|ubuntu)
debian|ubuntu|openwrt)
state="present"
[ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
;;

View file

@ -47,6 +47,13 @@ case "$state_should" in
echo chkconfig \"$name\" on
;;
openwrt)
# 'enable' can be successful and still return a non-zero exit
# code, deal with it by checking for success ourselves in that
# case (the || ... part).
echo "/etc/init.d/\"$name\" enable || [ -f /etc/rc.d/S??\"$name\" ]"
;;
*)
echo "Unsupported os: $os" >&2
exit 1
@ -74,6 +81,10 @@ case "$state_should" in
echo chkconfig \"$name\" off
;;
openwrt)
echo "\"/etc/init.d/$name\" disable"
;;
*)
echo "Unsupported os: $os" >&2
exit 1