diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-09-17 21:45:30 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-09-17 21:45:30 +0000 |
commit | 62ff68fba54acba199c9eb4aed7ac912cdfd50cf (patch) | |
tree | fc0c6034daf9bd0276dc91d027e26be26004680b /package/network/config/netifd | |
parent | d0682a9114c910576350e424bbfb8b12e2bd7c4f (diff) |
procd: convert various packages to procd style init.d scripts
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38023 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/config/netifd')
-rwxr-xr-x | package/network/config/netifd/files/etc/init.d/network | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network index 75586452f0..8031802e8d 100755 --- a/package/network/config/netifd/files/etc/init.d/network +++ b/package/network/config/netifd/files/etc/init.d/network @@ -3,17 +3,30 @@ START=20 STOP=90 -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 +USE_PROCD=1 -start() { - stop +start_service() { [ -e /proc/sys/kernel/core_pattern ] && { ulimit -c unlimited echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern } - service_start /sbin/netifd + procd_open_instance + procd_set_param command /sbin/netifd + procd_set_param respawn + procd_close_instance +} + +reload_service() { + ubus call network reload + /sbin/wifi down + /sbin/wifi up +} + +stop_service() { + /sbin/wifi down +} +service_running() { setup_switch() { return 0; } include /lib/network @@ -25,24 +38,20 @@ start() { /sbin/wifi up } +service_triggers() +{ + procd_add_reload_trigger "network" +} + restart() { ifdown -a sleep 1 - start + trap '' TERM + stop "$@" + start "$@" } shutdown() { ifdown -a stop } - -stop() { - /sbin/wifi down - service_stop /sbin/netifd -} - -reload() { - ubus call network reload - /sbin/wifi down - /sbin/wifi up -} |