logo

widrop

[mirror] WiDrop distribution, now defunct git clone https://hacktivis.me/git/mirror/widrop.git

postinst (1098B)


  1. #!/bin/sh
  2. interface=$(cat <<EOF
  3. # BEGIN WIDROP
  4. # DO NOT REMOVE THE BEGIN & END LINE
  5. auto wlan0
  6. iface wlan0 inet static
  7. address 10.42.0.1
  8. netmask 255.255.255.0
  9. # post-up /etc/init.d/hostapd restart
  10. hostapd /etc/hostapd.conf
  11. post-up /etc/init.d/dnsmasq restart
  12. post-up /etc/iptables.sh
  13. # END WIDROP
  14. EOF
  15. )
  16. case $1 in
  17. "configure")
  18. echo Creating widrop user
  19. getent group widrop >/dev/null 2>&1 ||
  20. addgroup widrop
  21. getent passwd widrop >/dev/null 2>&1 ||
  22. adduser --disabled-password widrop --ingroup widrop --gecos widrop
  23. echo Allowing password-less authentification
  24. pam-auth-update --package
  25. echo editing /etc/network/interfaces
  26. if grep WIDROP /etc/network/interfaces > /dev/null; then
  27. echo
  28. echo
  29. echo
  30. exit 0
  31. fi
  32. if grep wlan0 /etc/network/interfaces > /dev/null; then
  33. echo
  34. echo It seems that wlan0 is already in /etc/network/interfaces
  35. echo Adding a commented version of the config, please activate itby editing the /etc/network/interface file
  36. sed s/^/#/ interfaces >> /etc/network/interfaces
  37. fi;
  38. echo $interfaces >> /etc/network/interfaces
  39. ;;
  40. esac
  41. exit 0