updated on Sat Jan 21 04:00:54 UTC 2012
[aur-mirror.git] / daemontools / daemontools.install
blobf79afcb744397247849ad1b2e7f6861d67e5b83f
1 post_install() {
2         if grep svscanboot /etc/inittab >/dev/null
3         then
4                 echo 'inittab contains an svscanboot line. I assume that svscan is already running.'
5         else
6                 echo 'Adding svscanboot to inittab...'
7                 rm -f /etc/inittab'{new}'
8                 cat /etc/inittab > /etc/inittab'{new}'
9                 echo "sv:123456:respawn:/usr/sbin/svscanboot" >> /etc/inittab'{new}'
10                 mv -f /etc/inittab'{new}' /etc/inittab || exit 1
11                 kill -HUP 1
12                 echo 'init should start svscan now.'
13         fi
16 post_remove() {
17         if grep svscanboot /etc/inittab >/dev/null
18         then
19                 echo 'Removing svscanboot from inittab...'
20                 rm -f /etc/inittab'{old}' 
21                 sed -e '/^sv:/d' /etc/inittab > /etc/inittab'{old}' || exit 1
22                 mv -f /etc/inittab'{old}' /etc/inittab || exit 1
23                 kill -HUP 1
24                 echo 'init should stop svscan now.'
25         fi
28 post_upgrade() {
29         kill -HUP 1