postinst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. # postinst script for portspoof-ng
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # summary of how this script can be called:
  7. # * <postinst> `configure' <most-recently-configured-version>
  8. # * <old-postinst> `abort-upgrade' <new version>
  9. # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  10. # <new-version>
  11. # * <postinst> `abort-remove'
  12. # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  13. # <failed-install-package> <version> `removing'
  14. # <conflicting-package> <version>
  15. # for details, see https://www.debian.org/doc/debian-policy/ or
  16. # the debian-policy package
  17. IPTABLES='/sbin/iptables'
  18. COMMAND="${IPTABLES} -t nat -A PREROUTING -p tcp --destination ${IP} \
  19. -m multiport ! --dports ${PORTS} -j REDIRECT --to-ports ${LISTENPORT}"
  20. case "$1" in
  21. configure)
  22. printf "portspoof-ng needs iptables to be configured."
  23. printf "I do something like: \n"
  24. printf "$COMMAND\n"
  25. ;;
  26. abort-upgrade|abort-remove|abort-deconfigure)
  27. ;;
  28. *)
  29. echo "postinst called with unknown argument \`$1'" >&2
  30. exit 1
  31. ;;
  32. esac
  33. # dh_installdeb will replace this with shell code automatically
  34. # generated by other debhelper scripts.
  35. #DEBHELPER#
  36. exit 0