1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/bash -e
update-rc.d ipmasq start 46 S . >/dev/null
update-rc.d ipmasq-kmod start 47 S . >/dev/null
if [ "$1" = "configure" ]; then
# remove old rc.boot file if exists
if [ -e /etc/rc.boot/ipmasq ]; then
echo -n "Should I delete the old /etc/rc.boot/ipmasq boot file? [Y/n] "
read rcboot
case $rcboot in
[Nn]*) ;;
*) rm -f /etc/rc.boot/ipmasq;;
esac
fi
case $2 in
2*) # version 2.x
if [ -e /etc/ipmasq.conf ]; then
echo "The configuration file /etc/ipmasq.conf is no longer used and the"
echo "information it contains is determined automatically by ipmasq. Should"
echo -n "I delete the file /etc/ipmasq.conf? [Y/n] "
read answer
case $answer in
[Nn]*) ;;
*) rm -f /etc/ipmasq.conf;;
esac
fi
;;
esac
if [ -e /etc/ipmasq.rules ]; then
echo "Should I move your /etc/ipmasq.rules into the /etc/ipmasq/rules"
echo -n "directory? [Y/n] "
read answer
case $answer in
[Nn]*) ;;
*) mv /etc/ipmasq.rules /etc/ipmasq/rules/Z99ipmasqrules.rul;;
esac
fi
if [ ! -e /etc/ipmasq/ppp ]; then
echo "Do you wish to have ipmasq recompute the firewall rules when"
echo -n "pppd brings up or takes down a link? [Y/n] "
read ppp
case $ppp in
[Nn]*) echo "This feature may be turned on by creating a file /etc/ipmasq/ppp";;
*) cp /usr/share/ipmasq/etc-ipmasq-ppp-message /etc/ipmasq/ppp
echo "This feature may be turned off by deleting the file /etc/ipmasq/ppp";;
esac
echo -n "Press ENTER to continue."
read dummy
fi
echo -n "Should I start IP Masquerading? [Y/n] "
read startme
case $startme in
[Nn]*) ;;
*) /etc/init.d/ipmasq start
/etc/init.d/ipmasq-kmod start
;;
esac
fi
#DEBHELPER#
|