# arg 1: the new package version pre_install () { if [ ! -f /sbin/halt-init ] then mv /sbin/halt /sbin/halt-init mv /sbin/shutdown /sbin/shutdown-init fi rm -f /sbin/reboot rm -f /sbin/poweroff } pre_upgrade () { if [ ! -f /sbin/halt-init ] then mv /sbin/halt /sbin/halt-init fi if [ ! -f /sbin/shutdown-init ] then mv /sbin/shutdown /sbin/shutdown-init fi rm -f /sbin/reboot rm -f /sbin/poweroff } post_install () { mkdir /var/service ln -s /sbin/halt.script /sbin/halt ln -s /sbin/reboot.script /sbin/reboot ln -s /sbin/poweroff.script /sbin/poweroff ln -s /sbin/halt-init /sbin/reboot.init ln -s /sbin/halt-init /sbin/poweroff.init ln -s /sbin/shutdown.script /sbin/shutdown } # arg 1: the new package version # arg 2: the old package version post_upgrade(){ ln -s /sbin/halt.script /sbin/halt ln -s /sbin/reboot.script /sbin/reboot ln -s /sbin/poweroff.script /sbin/poweroff ln -s /sbin/halt-init /sbin/reboot.init ln -s /sbin/halt-init /sbin/poweroff.init ln -s /sbin/shutdown.script /sbin/shutdown } op=$1 shift $op $*