首页 > 代码库 > lab-bill-sys-killservers-davidey

lab-bill-sys-killservers-davidey

#!/bin/sh

services="bluetooth cups firstboot gpmhidd hplip ip6tables isdn pcscd xfs xinetd yum-updatesd messagebus abrtd

 

abrt-oops abrt-ccpp avahi-daemonrhsmcertd"

 

for service in $services

do

  if[ -f "/etc/init.d/$service" ]

   then

   if [ $service == ‘xinetd‘ ]

     then

     grep -r disable /etc/xinetd.*  |sed ‘s/.*://‘ | grep -v ^#  | sed  ‘s/\s//g‘ | grep -q -v "disable=yes"

     if [ $? == 0 ]

       then

       echo "xinetd in Using."

     else

       /etc/init.d/xinetd stop && echo "xinetd stop success."

       chkconfig xinetd off && echo "xinetd stop on powered upsuccess." || echo "xinetd stop on powered up

 

failed."

     fi

   else

     /etc/init.d/$service stop && echo "$service stopsuccess."

     chkconfig $service off && echo "$service stop on powered upsuccess." || echo "$service stop on powered up

 

failed."

   fi

 else

   echo "$service not existed."

  fi

done

 

很晚完成该文档,尽管每一天工作强度很大,还是愿意与大家一起进步。呵呵每天进步一点。

 

后续介绍其他模块,有什么问题敬请大家不要吝啬指出,一同改进。欢迎大家和大家的技术发烧友一起加入我们的qq262407268,共建我们的《云络智慧城市》


本文出自 “DavideyLee” 博客,请务必保留此出处http://davideylee.blog.51cto.com/8703117/1439226