# arg 1: the new package version post_install() { grep -q 'sshd: ALL' /etc/hosts.allow [ $? != 0 ] && echo 'sshd: ALL' >> /etc/hosts.allow sed -i '/^DAEMONS=/s/!sshd/sshd/' /etc/rc.conf 2>/dev/null /bin/true } # arg 1: the new package version # arg 2: the old package version post_upgrade() { /bin/true } # arg 1: the old package version pre_remove() { /etc/rc.d/sshd stop 2> /dev/null /bin/true } # arg 1: the old package version post_remove() { sed -i '/^sshd: /d' /etc/hosts.allow 2>/dev/null sed -i '/^DAEMONS=/s/sshd/!sshd/' /etc/rc.conf 2>/dev/null /bin/true } op=$1 shift $op $*