|
发表于 2003-12-16 13:20:16
|
显示全部楼层
#!/bin/bash
count()
{
a=0
for i in $(chkconfig --list|awk '{print $8}') ;do
a=$(($a+1))
if [ $i == NULL ] ;then
return $a;exit 1
fi;done
}
b=`count`
for i in $(chkconfig --list|head -n $b|awk '{ print $1}');do
chkconfig --level 35 $i off
done
chkconfig --level 5 xfs on
chkconfig --level 35 network on
chkconfig --level 3 syslog on
chkconfig --level 35 iptables on
chkconfig --level 35 crond on
echo "--- level 3 ---"
chkconfig --list | grep "3 n"|awk '{print $1}'
echo "--- level 5 ---"
chkconfig --list | grep "5 n"|awk '{print $1}' |
|