例子,关闭linux系统服务的shell脚本。
复制代码 代码示例:
#!/bin/bash
# www.jquerycn.cn
for ser in `chkconfig --list |grep 3:on |awk '{print $1}'`
do
echo $ser
case $ser in (crond | irqbalance | microcode_ctl | network | random | sendmail \
| sshd | syslog | messagebus | haldaemon | readahead_early \
| apmd | readahead_later | readahead | iptables \
| lvm2-monitor|xinetd | auditd | cpuspeed )
echo "Base services, Skip"
;;
*)
echo "change $ser to off"
chkconfig --level 3 $ser off
service $ser stop
;;
esac
done