One of my Centos boot script Generation 1, switch to/etc/init. d/2, and create sh script vi andy. sh [plain] #! /Bin/sh # add for chkconfig # chkconfig: 2345 70 30 # description: the description of the shell # Brief description of the script # processname: andyStart # Name of the first process, it will be used when setting auto-start later # The following command to start the service/etc/init. d/mysqld start;/etc/init. d/httpd start;/sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT; service iptables save; service iptables restart; Description: 2345 indicates the script running level, that is, it can be run in both the 2345 and 234 modes. The mode is a text interface, and the 5 mode is a graphic interface. The mode indicates the sequence number of the script to be started in the future. If the sequence number of other programs is smaller than 70 For example, 44, 45), the script must be started only after these programs are started. 30 indicates the stop sequence number of the script when the system is disabled. Method 1 for executing multiple commands in shell scripts in linux 1. Use each command. Note: The execution of each command will not affect the execution of other commands. In other words, each command is executed, but it is not guaranteed that each command is successfully executed. 2. Separate each command with &. Note: if the preceding command is successfully executed, the subsequent command will be executed. This ensures that the execution process is successful after all commands are executed. 3. Use | to separate each command. Description: | yes or means that the next command is executed only when the previous command fails to be executed until the execution of the previous command is successful. 3. add executable permissions to the script: chmod + x andy. sh 4. Use the chkconfig command to set the script to self-start: chkconfig -- add andy. sh 5. Restart the script and try again!