diff options
author | Marco Bonetti <sid77@slackware.it> | 2010-08-24 00:24:11 -0400 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2010-08-29 15:32:12 -0500 |
commit | 6b3dcddbf803c1f7dbbd7b821b559274cd421321 (patch) | |
tree | 9e32cceb06ce48bdd454a7a69d485835fe54ea3a /network/ttdnsd/doinst.sh | |
parent | 32376e2b76b9415697b832cf686ecb9b0b3b49fd (diff) | |
download | slackbuilds-6b3dcddbf803c1f7dbbd7b821b559274cd421321.tar.gz |
network/ttdnsd: Added (The Tor TCP DNS Daemon)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/ttdnsd/doinst.sh')
-rw-r--r-- | network/ttdnsd/doinst.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/network/ttdnsd/doinst.sh b/network/ttdnsd/doinst.sh new file mode 100644 index 0000000000..727782007d --- /dev/null +++ b/network/ttdnsd/doinst.sh @@ -0,0 +1,28 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.ttdnsd.new +config etc/default/ttdnsd.new +config etc/ttdnsd.conf.new +config var/lib/ttdnsd/tsocks.conf.new |