centos 7下用了版本6下的脚本,总是报错,于是拷贝了nginx一键安装包里面的一个版本,结果可以,贴出来 #! /bin/sh # chkconfig: # Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and # run 'update-rc.d -f nginx defaults', or use the appropriate command on your # dist
#!/bin/bash #this script is appropriate .x(这脚本适合最小化安装6.x版本的系统) #you have already install the os read -p "Pleases input hostname for linux:" hname sed -i "/HOSTNAME/s/localhost\.localdomain/$hname/g" /etc/sysconfig/network sed -i 's/enf
转载自http://www.2cto.com/os/201306/220559.html 我的一个Centos开机自启动脚本的制作 一.切换到/etc/init.d/ 二.制作sh脚本 vi andy.sh [plain] #!/bin/sh #add for chkconfig #chkconfig: 2345 70 30 #description: the description of the shell #关于脚本的简短描述 #processname