# arg 1: the new package version pre_install() { # # do pre-install stuff here # grep news /etc/group >/dev/null if [ $? != 0 ]; then groupadd -g 13 news fi grep news /etc/passwd >/dev/null if [ $? != 0 ]; then useradd -u 13 -g news -s /bin/false news fi /bin/true } # arg 1: the new package version post_install() { # # do post-install stuff here # echo "" echo "------------------------------------------------------------------------" echo "" echo "Pakiet leafnode został zainstalowany. " echo "Pamiętaj aby po zakończeniu instalacji zmienić nazwy plików w katalogu " echo "/etc/leafnode (config.example na config i filters.exsmple na filters). " echo "Następnie w pliku /etc/xinetd.d/nntp zmień linię 'disable = yes' na " echo "'disable = no'. Skonfigureuj serwer edytując pliki /etc/leafnode/config" echo "i /etc/leafnode/filters, a następnie zrestartuj serwer xinetd." echo "" echo "Domyślnie leafnode jest dostępny wyłącznie z sieci lokalnej. " echo "Jeśli chcesz aby serwer news był dostępny 'ze świata' musisz otworzyć " echo "dostęp do portu 119 (tcp). Pamiętaj, że w takiej sytuacji dostęp do " echo "serwera powinien być ograniczony tylko do użytkowników mających " echo "odpowiednie konta. " echo "" echo "Więcej informacji na temat konfiguracji i używania Leafnode znajdziesz " echo "w manualach, musisz jednak zainstalować pakiet leafnode-man." echo "" echo "------------------------------------------------------------------------" echo "" grep nntp /etc/hosts.allow 2>/dev/null if [ $? != 0 ]; then sed -i '/^# End of file$/i\nntp: 192.168.1.0/24' /etc/hosts.allow fi /bin/true } # arg 1: the new package version # arg 2: the old package version pre_upgrade() { # # do pre-upgrade stuff here # grep news /etc/group >/dev/null if [ $? != 0 ]; then groupadd -g 13 news fi grep news /etc/passwd >/dev/null if [ $? != 0 ]; then useradd -u 13 -g news -s /usr/bin/news news fi /bin/true } # arg 1: the new package version # arg 2: the old package version post_upgrade() { # # do post-upgrade stuff here # grep nntp /etc/hosts.allow 2>/dev/null if [ $? != 0 ]; then sed -i '/^# End of file$/i\nntp: 192.168.1.0/24' /etc/hosts.allow fi /bin/true } # arg 1: the old package version pre_remove() { # # do pre-remove stuff here # /bin/true } # arg 1: the old package version post_remove() { # # do post-remove stuff here # grep news /etc/group >/dev/null if [ $? = 0 ]; then groupdel news fi grep news /etc/passwd >/dev/null if [ $? = 0 ]; then userdel news fi grep nntp /etc/hosts.allow 2>/dev/null if [ $? = 0 ]; then sed -i '/^nntp:/d' /etc/hosts.allow fi /bin/true } op=$1 shift $op $*