文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>交互式删除Linux or Solaris系统下不必要的服务脚本

交互式删除Linux or Solaris系统下不必要的服务脚本

时间:2008-07-14  来源:jackylau

#!/bin/sh
# Author: jackylau <[email protected]>
# Description: delete disnecessary service for Linux or SunOS

PATH=/sbin:/bin:/usr/bin

case `uname -s` in
SunOS)
echo
echo "Yours Operation System is Solaris? if not,Please press "Ctrl+c"!"
delser(){
for i in `ls /etc/rc2.d/S*`
do
SERVICE=${i#/etc/rc2.d/S??}
for SE in $SERVICE
do
echo $SE

done
echo -n "Will you delete the $i service ?[y/n/Y/N/yes/no]"
SER=${i#/etc/rc2.d/}
read answer
case $answer in
Y|y|yes)
mv $SER _$SER
;;
N|n|no)
continue
;;
*)
echo -n "please Y|y or N|n,thanks!"
echo -n "Will you delete the $j service ?"
read answer
;;
esac
done

}
cd /etc/rc2.d
delser
cd /etc/rc3.d
delser
;;
Linux)
echo
echo "Yours Operation System is Linux? if not,Please press "Ctrl+c"!"
for j in `chkconfig --list|awk '{if($5~/on/ && NF>3) print $1}'|awk '{print $1}'`
do
echo -n "Will you delete the $j service ?[y/n/Y/N/yes/no]"
read answer
case $answer in
Y|y|yes)
chkconfig --level 35 $j off
;;
N|n|no)
continue
;;
*)
echo -n "please Y|y or N|n,!"
echo -n "Will you delete the $j service ?"
read answer
;;
esac
done
;;
*)
echo "Your Server don't supported the script"
;;
esac
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载