Mercurial > noffle
comparison debian/postinst @ 416:fbdcd908aa7c noffle
[svn] fixed udpate-inetd
| author | godisch |
|---|---|
| date | Fri, 20 Jun 2003 06:46:49 +0100 |
| parents | b9018588cc52 |
| children | e5153104fbd9 |
comparison
equal
deleted
inserted
replaced
| 415:a7dbefcafc43 | 416:fbdcd908aa7c |
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # $Id: postinst 554 2003-06-19 22:25:30Z godisch $ | 2 # $Id: postinst 559 2003-06-20 05:46:49Z godisch $ |
| 3 | 3 |
| 4 set -e | 4 set -e |
| 5 | 5 |
| 6 [ "$1" = configure ] || exit 0 | 6 [ "$1" = configure ] || exit 0 |
| 7 | 7 |
| 30 # 1.1.2-1 was in unstable only, don't notify | 30 # 1.1.2-1 was in unstable only, don't notify |
| 31 mv -f /etc/noffle.conf $server_config || : | 31 mv -f /etc/noffle.conf $server_config || : |
| 32 mv -f /etc/noffle.conf.old $server_config.old 2> /dev/null || : | 32 mv -f /etc/noffle.conf.old $server_config.old 2> /dev/null || : |
| 33 fi | 33 fi |
| 34 | 34 |
| 35 # maybe disabled only, e.g. dpkg -r noffle | |
| 36 update-inetd --remove "/usr/bin/noffle -r" || : | |
| 37 if [ -e /usr/share/debconf/confmodule ]; then | 35 if [ -e /usr/share/debconf/confmodule ]; then |
| 38 . /usr/share/debconf/confmodule | 36 . /usr/share/debconf/confmodule |
| 39 db_version 2.0 | 37 db_version 2.0 |
| 40 db_get noffle/debconf | 38 db_get noffle/debconf |
| 41 if [ "$RET" = true ]; then | 39 if [ "$RET" = true ]; then |
| 42 db_get noffle/port | 40 db_get noffle/port |
| 43 port="$RET" | 41 port="$RET" |
| 44 if [ -z "$port" -o "$port" = 119 ]; then | 42 if [ -z "$port" -o "$port" = 119 ]; then |
| 45 port=nntp | 43 port=nntp |
| 46 fi | 44 fi |
| 45 # maybe disabled only, e.g. dpkg -r noffle | |
| 46 update-inetd --remove "/usr/bin/noffle -r" || : | |
| 47 update-inetd --group MAIL --add "$port\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" | 47 update-inetd --group MAIL --add "$port\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" |
| 48 db_get noffle/server | 48 db_get noffle/server |
| 49 server="$RET" | 49 server="$RET" |
| 50 [ "$server" ] || server=news | 50 [ "$server" ] || server=news |
| 51 db_get noffle/username | 51 db_get noffle/username |
| 101 if [ ! -e $debian_config ]; then | 101 if [ ! -e $debian_config ]; then |
| 102 umask 022 | 102 umask 022 |
| 103 cp -f /usr/share/noffle/conf.debian $debian_config.new | 103 cp -f /usr/share/noffle/conf.debian $debian_config.new |
| 104 mv -fb $debian_config.new $debian_config | 104 mv -fb $debian_config.new $debian_config |
| 105 fi | 105 fi |
| 106 update-inetd --group MAIL --add "nntp\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" | 106 if ! grep -q "/usr/bin/noffle -r" /etc/inetd.conf; then |
| 107 # just an example, the user need to activate it himself | |
| 108 update-inetd --group MAIL --add "nntp\tstream\ttcp\tnowait\tnews\t/usr/sbin/tcpd /usr/bin/noffle -r" | |
| 109 update-inetd --disable "$port" | |
| 110 fi | |
| 107 fi | 111 fi |
| 108 | 112 |
| 109 # sanity checks | 113 # sanity checks |
| 110 chown -R news:news /var/lock/noffle /var/spool/noffle | 114 chown -R news:news /var/lock/noffle /var/spool/noffle |
| 111 chmod -R go-w /var/lock/noffle /var/spool/noffle | 115 chmod -R go-w /var/lock/noffle /var/spool/noffle |
