# 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 -w '^DAEMONS.*proftpd' /etc/rc.conf >/dev/null if [ $? = 0 ]; then grep '^DAEMONS.*!proftpd' /etc/rc.conf >/dev/null if [ $? = 0 ]; then sed -i '/^DAEMONS=/s/!proftpd/proftpd/' /etc/rc.conf else /bin/true fi else sed -i '/^DAEMONS=/s/)$/ proftpd)/' /etc/rc.conf fi /bin/true } # arg 1: the new package version # arg 2: the old package version pre_upgrade() { # # do pre-upgrade stuff here # /bin/true } # arg 1: the new package version # arg 2: the old package version post_upgrade() { # # do post-upgrade stuff here # grep -w '^DAEMONS.*proftpd' /etc/rc.conf >/dev/null if [ $? = 0 ]; then grep '^DAEMONS.*!proftpd' /etc/rc.conf >/dev/null if [ $? = 0 ]; then sed -i '/^DAEMONS=/s/!proftpd/proftpd/' /etc/rc.conf else /bin/true fi else sed -i '/^DAEMONS=/s/)$/ proftpd)/' /etc/rc.conf fi /bin/true } # arg 1: the old package version pre_remove() { # # do pre-remove stuff here # /etc/rc.d/proftpd stop /bin/true } # arg 1: the old package version post_remove() { # # do post-remove stuff here # sed -i '/^DAEMONS=/s/ proftpd//' /etc/rc.conf 2>/dev/null sed -i '/^DAEMONS=/s/ !proftpd//' /etc/rc.conf 2>/dev/null /bin/true } op=$1 shift $op $*