diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-05-24 00:06:15 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-06-05 02:40:03 +0100 |
commit | 4a915274f2ef8986a4e86be38991e8e2f6164e6b (patch) | |
tree | 2e8fb2abe5f41147c4fc1638d3c1c4e569182dea /debian/nyancat-server.postinst | |
parent | 5e32cdf40e509285ca38e630fd476d5da1350f48 (diff) | |
download | nyancat-4a915274f2ef8986a4e86be38991e8e2f6164e6b.tar.gz |
Re-enable reconf-inetd
Diffstat (limited to 'debian/nyancat-server.postinst')
-rw-r--r-- | debian/nyancat-server.postinst | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/debian/nyancat-server.postinst b/debian/nyancat-server.postinst index c723125..757eea5 100644 --- a/debian/nyancat-server.postinst +++ b/debian/nyancat-server.postinst @@ -2,8 +2,27 @@ set -e -# Set up nyancat -update-inetd --group OTHER --add \ - '#<off># telnet\t\tstream\ttcp\tnowait\tnobody\t/usr/bin/nyancat\tnyancat -t' +OLD_NYANCAT_ENTRY="telnet stream tcp nowait nobody /usr/bin/nyancat nyancat -t" +RELEASE="1.0+git20120523.99dc310-1" + +case "$1" in + configure) + # if upgrading from previous non reconf-inetd version + if dpkg --compare-versions "$2" lt-nl "$RELEASE"; then + # remove previous update-inetd entry if unmodified + if fgrep -qx "#<off># $OLD_NYANCAT_ENTRY" /etc/inetd.conf || \ + fgrep -qx "$OLD_NYANCAT_ENTRY" /etc/inetd.conf; then + if [ -x /usr/sbin/update-inetd ]; then + # remove nyancat reconf-inetd entries + update-inetd --multi --pattern nyancat --remove telnet || true + if [ -x /usr/sbin/reconf-inetd ]; then + # add the nyancat-server entries back again + reconf-inetd || true + fi + fi + fi + fi + ;; +esac #DEBHELPER# |