教程集 www.jiaochengji.com
教程集 >  脚本编程  >  shell  >  正文 关闭linux系统服务的shell脚本

关闭linux系统服务的shell脚本

发布时间:2014-12-18   编辑:jiaochengji.com
使用shell脚本关闭linux系统服务,是非常方便的,本文介绍一个关闭linux服务的shell脚本代码,有需要的朋友参考下。

例子,关闭linux系统服务的shell脚本。
 

复制代码 代码示例:
#!/bin/bash
# www.jiaochengji.com
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

您可能感兴趣的文章:
关闭linux系统服务的shell脚本
python shell是什么
linux下用脚本实现自动ftp的方法
ubuntu下使用chkconfig命令
linux下打开与关闭tomcat 实时查看tomcat运行日志
linux下mysql 5.5.8 源码编译安装
php网站用什么服务器
python脚本如何测试手机
inux shell初级入门教程
vps自动备份shell脚本代码

关键词: 系统服务   
[关闭]
~ ~