Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switchrepo tdi
- cat >> /etc/init.d/yummy << EOF
- #!/bin/sh
- # chkconfig: 345 99 01
- # description: Update yum on shutdown or reboot
- lockfile=/var/lock/subsys/yummy
- start () {
- touch $lockfile
- }
- stop () {
- yum -y update
- [ -f "${lockfile}" ] && rm -f /var/lock/subsys/yummy
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart}"
- esac
- EOF
- chmod +x /etc/init.d/yummy
- chkconfig --add yummy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement