diff options
author | dsomero <xgizzmo@slackbuilds.org> | 2011-04-08 19:05:32 -0400 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-04-11 00:10:56 -0500 |
commit | c9c7692638f920da77321df9a54b644909001299 (patch) | |
tree | dc2ca1510e8f3bcf2581b3a24849bacbb03c928e /network/squid/doinst.sh | |
parent | 56d5e2206f961773fface7b49c73896ab892f084 (diff) | |
download | slackbuilds-c9c7692638f920da77321df9a54b644909001299.tar.gz |
network/squid: Updated for version 3.1.12.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/squid/doinst.sh')
-rw-r--r-- | network/squid/doinst.sh | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/network/squid/doinst.sh b/network/squid/doinst.sh index c811e9a972..664a873749 100644 --- a/network/squid/doinst.sh +++ b/network/squid/doinst.sh @@ -5,24 +5,26 @@ config() { if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then - rm $NEW # toss the redundant copy + # toss the redundant copy + rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.squid.new: -if [ -e etc/rc.d/rc.squid ]; then - cp -a etc/rc.d/rc.squid etc/rc.d/rc.squid.new.incoming - cat etc/rc.d/rc.squid.new > etc/rc.d/rc.squid.new.incoming - mv etc/rc.d/rc.squid.new.incoming etc/rc.d/rc.squid.new -else - # Install executable otherwise - irrelevant unless user starts in rc.local - chmod 0755 etc/rc.d/rc.squid.new -fi +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 +} -config etc/rc.d/rc.squid.new -config etc/squid/mime.conf.new -config etc/squid/squid.conf.new -config etc/squid/cachemgr.conf.new -config etc/logrotate.d/squid.new +preserve_perms etc/rc.d/rc.squid.new +preserve_perms etc/squid/mime.conf.new +preserve_perms etc/squid/squid.conf.new +preserve_perms etc/squid/cachemgr.conf.new +preserve_perms etc/logrotate.d/squid.new |