# HG changeset patch # User Pascal Bellard # Date 1352552081 -3600 # Node ID 07ae6003d0131290fbe81d0b229b69a414087ba9 # Parent fe2a41dfcd6d86fbfbf4739d9b1bc425d23c23d5 pdns: add post_install diff -r fe2a41dfcd6d -r 07ae6003d013 pdnsd/receipt --- a/pdnsd/receipt Sat Nov 10 11:39:11 2012 +0100 +++ b/pdnsd/receipt Sat Nov 10 13:54:41 2012 +0100 @@ -28,3 +28,25 @@ rm -rf $fs/usr/share mv $fs/etc/pdnsd.conf.sample $fs/etc/pdnsd.conf } + +# Pre and post install commands for Tazpkg. +pre_remove() +{ + sed -i 's/ pdns / /' $1/etc/rcS.conf + rm -f $1/etc/init.d/pdns +} + +post_install() +{ + local tmp + tmp=$(route -n | awk '/^0.0.0.0/ { print $8; }') + [ -n "$tmp" ] && sed -i "s/eth0/$tmp/" $1/etc/pdns.conf + tmp=$(sed '/nameserver/!d;s/nameserver //;q' < /etc/resolv.conf) + [ -n "$tmp" ] && sed -i "s/192\.168\.0\.1/$tmp/" $1/etc/pdns.conf + tmp= + [ -s $1/etc/init.d/daemon ] && ln -s daemon $1/etc/init.d/pdns && + tmp=" and add pdns to RUN_DAEMONS in /etc/rcS.conf" + cat <