# arg 1: the new package version pre_install() { # # do pre-install stuff here # /bin/true } # arg 1: the new package version post_install() { # # do post-install stuff here # grep '^DAEMONS' /etc/rc.conf | grep lanchat >/dev/null [ $? = 0 ] || sed -i '/^DAEMONS=/s/)$/ lanchat)/' /etc/rc.conf [ -f /etc/rc.d/lanchat ] && /etc/rc.d/lanchat start /bin/true } # arg 1: the new package version # arg 2: the old package version pre_upgrade() { # # do pre-upgrade stuff here # [ -f /etc/rc.d/lanchat ] && /etc/rc.d/lanchat stop /bin/true } # arg 1: the new package version # arg 2: the old package version post_upgrade() { # # do post-upgrade stuff here # grep '^DAEMONS' /etc/rc.conf | grep lanchat >/dev/null [ $? = 0 ] || sed -i '/^DAEMONS=/s/)$/ lanchat)/' /etc/rc.conf [ -f /etc/rc.d/lanchat ] && /etc/rc.d/lanchat start /bin/true } # arg 1: the old package version pre_remove() { # # do pre-remove stuff here # [ -f /etc/rc.d/lanchat ] && /etc/rc.d/lanchat stop /bin/true } # arg 1: the old package version post_remove() { # # do post-remove stuff here # grep '^DAEMONS' /etc/rc.conf | grep lanchat >/dev/null [ $? = 0 ] && sed -i '/^DAEMONS=/s/ lanchat//' /etc/rc.conf /bin/true } op=$1 shift $op $*