2 # Copyright (C) 2006-2009 OpenWrt.org
4 .
$IPKG_INSTROOT/etc
/functions.sh
37 name
="$(basename "${initscript}")"
38 rm -f "$IPKG_INSTROOT"/etc
/rc.d
/S??
$name
39 rm -f "$IPKG_INSTROOT"/etc
/rc.d
/K??
$name
43 name
="$(basename "${initscript}")"
45 [ -n "$START" -o -n "$STOP" ] ||
{
46 echo "/etc/init.d/$name does not have a START or STOP value"
49 [ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
50 [ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}"
54 name
="$(basename "${initscript}")"
55 [ -x "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" ]
64 Syntax: $initscript [command]
67 start Start the service
69 restart Restart the service
70 reload Reload configuration files (or restart if that fails)
71 enable Enable service autostart
72 disable Disable service autostart
79 ALL_COMMANDS
="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
80 list_contains ALL_COMMANDS
"$action" || action
=help
81 [ "$action" = "reload" ] && action
='eval reload "$@" || restart "$@" && :'