aboutsummaryrefslogtreecommitdiff
path: root/system/powernowd/doinst.sh
diff options
context:
space:
mode:
authorDavid Woodfall <dave@dawoodfall.net>2018-03-27 12:45:36 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-03-31 07:41:32 +0700
commit64f4acc4470ecd7e190df67312f9e0238db2d8a2 (patch)
tree845d8277289c618d562be7c8f2c7eb1285b066da /system/powernowd/doinst.sh
parentc69d1c195ba228f8a13adebf400042520cee3c93 (diff)
system/powernowd: Add rc file + switch to i586.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/powernowd/doinst.sh')
-rw-r--r--system/powernowd/doinst.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/system/powernowd/doinst.sh b/system/powernowd/doinst.sh
new file mode 100644
index 000000000000..7a50fb2987f5
--- /dev/null
+++ b/system/powernowd/doinst.sh
@@ -0,0 +1,25 @@
+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.powernowd.new