diff options
author | Jason Graham <jgraha8@gmail.com> | 2018-05-07 22:45:06 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-05-12 06:58:24 +0700 |
commit | 00c3f3759fc4625ff778ba2624b0faccf80eef51 (patch) | |
tree | 0c804c8343213d9ff248276909aec7e1655b926e /system/powerpanel/doinst.sh | |
parent | 74d1e63c6791419d1ffc11b1597842b77feb95df (diff) | |
download | slackbuilds-00c3f3759fc4625ff778ba2624b0faccf80eef51.tar.gz |
system/powerpanel: Added (CyberPower PowerPanel Personal Edition).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/powerpanel/doinst.sh')
-rw-r--r-- | system/powerpanel/doinst.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/system/powerpanel/doinst.sh b/system/powerpanel/doinst.sh new file mode 100644 index 0000000000..ad28a04088 --- /dev/null +++ b/system/powerpanel/doinst.sh @@ -0,0 +1,23 @@ +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 +} |