|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/etc/rc3.d/ |
Upload File : |
#!/bin/bash
#
# yum This shell script enables the automatic use of YUM
#
# Author: Seth Vidal <skvidal@phy.duke.edu>
#
# chkconfig: - 50 01
#
# description: Enable daily run of yum, a program updater.
# processname: yum
# config: /etc/yum.conf
#
# source function library
. /etc/rc.d/init.d/functions
lockfile=/var/lock/subsys/yum
RETVAL=0
start() {
echo -n $"Enabling nightly yum update: "
touch "$lockfile" && success || failure
RETVAL=$?
echo
}
stop() {
echo -n $"Disabling nightly yum update: "
rm -f "$lockfile" && success || failure
RETVAL=$?
echo
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
reload)
;;
condrestart)
[ -f "$lockfile" ] && restart
;;
status)
if [ -f $lockfile ]; then
echo $"Nightly yum update is enabled."
RETVAL=0
else
echo $"Nightly yum update is disabled."
RETVAL=3
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
exit 1
esac
exit $RETVAL