#! /bin/sh set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. install_init() { PROD=wanrouter START_SCRIPT=20 STOP_SCRIPT=10 PROD_INIT=/usr/sbin/wanrouter # Examine system bootstrap files. if [ -d /etc/rc0.d ]; then RC_DIR=/etc elif [ -d /etc/rc.d/rc0.d ]; then RC_DIR=/etc/rc.d else return 0 fi # Create Symbolic Link to Wanrouter binary if [ ! -f "/etc/init.d/wanrouter" ]; then ln -sf $PROD_INIT $RC_DIR/init.d/wanrouter echo "Created SymLink of $PROD_INIT to $RC_DIR/init.d/wanrouter" echo fi # Install start/stop scripts. update-rc.d wanrouter defaults $START_SCRIPT $STOP_SCRIPT return 0 } case "$1" in configure) if [ -d "/usr/local/wanrouter" ]; then cat < /dev/null fi cat < /dev/null 2>&1" echo eval "modprobe wanrouter" if [ $? -eq 0 ]; then eval "modprobe -r wanrouter" if [ $? -eq 0 ]; then echo "Module loaded/unloaded to test" fi else echo "Failed to load wanpipe modules!" echo echo "Make sure you are installing correct DEBS for your system!" echo echo "Otherwise call Sangoma Tech Support" fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac exit 0