From 831a6b69396a7f8a1bf8d66b6d4b649a4a7d80e0 Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Sun, 16 Apr 2017 00:13:45 +0700 Subject: network/vnstat: Updated for version 1.17 + new maintainer. Signed-off-by: Willy Sudiarto Raharjo --- network/vnstat/doinst.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'network/vnstat/doinst.sh') diff --git a/network/vnstat/doinst.sh b/network/vnstat/doinst.sh index 052e2f8929..5806a5036d 100644 --- a/network/vnstat/doinst.sh +++ b/network/vnstat/doinst.sh @@ -11,12 +11,16 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.vnstat.new: -if [ -e etc/rc.d/rc.vnstat ]; then - cp -a etc/rc.d/rc.vnstat etc/rc.d/rc.vnstat.new.incoming - cat etc/rc.d/rc.vnstat.new > etc/rc.d/rc.vnstat.new.incoming - mv etc/rc.d/rc.vnstat.new.incoming etc/rc.d/rc.vnstat.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.vnstat.new +preserve_perms etc/rc.d/rc.vnstat.new config etc/vnstat.conf.new -- cgit v1.2.3