# arg 1: the new package version post_install() { if [ ! "`/usr/bin/grep ^SV:345:respawn:/usr/bin/svscan etc/inittab`" ]; then if [ ! "`/usr/bin/grep ^'# End of file' etc/inittab`" ]; then # The 'End of file' sentinel is missing, just append it to the end echo "SV:345:respawn:/usr/bin/svscan /service" >> etc/inittab else # prepend it before 'End of file' sentinel /usr/bin/sed -i "/# End of file/i\ SV:345:respawn:/usr/bin/svscan /service" etc/inittab fi telinit q fi } post_upgrade() { post_install $1 } # arg 1: the old package version pre_remove() { if [ "`/usr/bin/grep ^SV:345:respawn:/usr/bin/svscan etc/inittab`" ]; then /usr/bin/sed -i "/SV:345:respawn:\/usr\/bin\/svscan \/service/d" etc/inittab telinit q fi } # arg 1: the old package version post_remove() { /bin/true } op=$1 shift $op $* # vim: ts=2 sw=2 et ft=sh