1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/sh ################################ # Disable yum cron and daemons # ################################ if [ -e /etc/cron.hourly/yum-autoupdate ] || [ -e /etc/cron.hourly/yum ] || [ -e /etc/cron.daily/yum.cron ];then echo “++++++++++++++++++++++++++++++++++++++++++++++++” echo “Yum cron jobs are now disabled” rm -f /etc/cron.hourly/yum-autoupdate rm -f /etc/cron.hourly/yum rm -f /etc/cron.daily/yum.cron fi yum_status=`chkconfig –list |grep yum |grep “3:on”` service_name=`chkconfig –list |grep yum | cut -f 1` for serv in $service_name; do if [ "x$yum_status" != "x" ]; then echo “++++++++++++++++++++++++++++++++++++++++++++++++” echo “+ $serv has been switched to off” chkconfig $serv off fi if [ -e /var/lock/subsys/$serv ]; then /etc/init.d/$serv stop fi echo “Done $serv” done ###################################################### |