I have an init script that gets linked to /etc/rc.d/S70bridgemode
. After running /etc/init.d/bridgemode enable
, I list the /etc/rc.d directory to confirm it is there, but after running sync && reboot
, the entry is gone. Other init scripts work fine, only my script has a problem. Any ideas? I have tried recreating the file on the OpenWrt device, and changing ownership/permissions, but nothing has helped. Tracing /etc/init.d/enable shows no problems:
+ . /etc/init.d/bridgemode
+ START=70
+ '[' -n ]
+ ALL_COMMANDS='boot shutdown depends start stop restart reload enable disable enabled '
+ ALL_HELP='\tstart Start the service\n\tstop Stop the service\n\trestart Restart the service\n\treload Reload configurati'
+ list_contains ALL_COMMANDS enable
+ local 'var=ALL_COMMANDS'
+ local 'str=enable'
+ local val
+ eval 'val=" ${ALL_COMMANDS} "'
+ val=' boot shutdown depends start stop restart reload enable disable enabled '
+ '[' ' boot shutdown depends start stop restart reload' '!=' ' boot shutdown depends start stop restart reload enable disable enabled ' ]
+ enable
+ err=1
+ basename /etc/init.d/bridgemode
+ name=bridgemode
+ '[' 70 ]
+ ln -sf ../init.d/bridgemode /etc/rc.d/S70bridgemode
+ err=0
+ '[' ]
+ return 0
The script
#!/bin/sh /etc/rc.common
START=70
stop_service() {
killall quectel-CM
}
start_service() {
/usr/bin/bridge_mode.sh
}