diff options
author | Marco Bonetti <sid77@slackware.it> | 2010-05-12 23:32:41 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-12 23:32:41 +0200 |
commit | 54fed56da4e8d0f76e8cf9eac9ac54b09c6a6390 (patch) | |
tree | 055325f19c4cd9e1e55a51679331323ef17db713 /network/polipo/doinst.sh | |
parent | 045310e29ea3fe6b68510d9a2a3b96b6588f7248 (diff) |
network/polipo: Added to 12.2 repository
Diffstat (limited to 'network/polipo/doinst.sh')
-rw-r--r-- | network/polipo/doinst.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/network/polipo/doinst.sh b/network/polipo/doinst.sh new file mode 100644 index 000000000000..cd33693a41ea --- /dev/null +++ b/network/polipo/doinst.sh @@ -0,0 +1,22 @@ +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... +} + +# Keep same perms on rc.polipo.new: +if [ -e etc/rc.d/rc.polipo ]; then + cp -a etc/rc.d/rc.polipo etc/rc.d/rc.polipo.new.incoming + cat etc/rc.d/rc.polipo.new > etc/rc.d/rc.polipo.new.incoming + mv etc/rc.d/rc.polipo.new.incoming etc/rc.d/rc.polipo.new +fi + +config etc/rc.d/rc.polipo.new +config etc/polipo/config.new |