postinst (1098B)
- #!/bin/sh
- interface=$(cat <<EOF
- # BEGIN WIDROP
- # DO NOT REMOVE THE BEGIN & END LINE
- auto wlan0
- iface wlan0 inet static
- address 10.42.0.1
- netmask 255.255.255.0
- # post-up /etc/init.d/hostapd restart
- hostapd /etc/hostapd.conf
- post-up /etc/init.d/dnsmasq restart
- post-up /etc/iptables.sh
- # END WIDROP
- EOF
- )
- case $1 in
- "configure")
- echo Creating widrop user
- getent group widrop >/dev/null 2>&1 ||
- addgroup widrop
- getent passwd widrop >/dev/null 2>&1 ||
- adduser --disabled-password widrop --ingroup widrop --gecos widrop
- echo Allowing password-less authentification
- pam-auth-update --package
- echo editing /etc/network/interfaces
- if grep WIDROP /etc/network/interfaces > /dev/null; then
- echo
- echo
- echo
- exit 0
- fi
- if grep wlan0 /etc/network/interfaces > /dev/null; then
- echo
- echo It seems that wlan0 is already in /etc/network/interfaces
- echo Adding a commented version of the config, please activate itby editing the /etc/network/interface file
- sed s/^/#/ interfaces >> /etc/network/interfaces
- fi;
- echo $interfaces >> /etc/network/interfaces
- ;;
- esac
- exit 0