第一步:把脚本test.sh放到 /etc/init.d中,或者链接到init.d中
第二步:sudo update-rc.d test.sh defaults 99
99:表示优先级0——99,如果要用到网络最好是99
init.d说明:
rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d
0 - 停机
1 - 单用户模式
2 - 多用户,但是没有NFS ,不能使用网络
3 - 完全多用户模式,我最喜欢的模式
4 - “打酱油” 模式,没有用到
5 - X11 桌面模式
6 - 重新启动 (如果将默认启动模式设置为6,Linux将会不断重启)
卸载test.sh开机启动
sudo update-rc.d -f test.sh remove