Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- update() {
- #update interval in days
- intervall=10
- path="/var/tmp/autoupdate"
- update=$((`cat $path` + $intervall))
- if [ `date +%Y%j` -gt $update ]; then
- stat_busy "Updating"
- pacman --noconfirm -Suy && date +%Y%j > $path
- fi
- }
- . /etc/rc.conf
- . /etc/rc.d/functions
- case "$1" in
- start)
- stat_busy "Activating auto update"
- add_daemon autoupdate
- stat_done
- ;;
- stop)
- stat_busy "Checking auto update"
- update
- rm_daemon autoupdate
- stat_done
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement