summaryrefslogtreecommitdiff
path: root/network/hostapd/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'network/hostapd/doinst.sh')
-rw-r--r--network/hostapd/doinst.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/network/hostapd/doinst.sh b/network/hostapd/doinst.sh
index 16bfa3f184..868d8d6a43 100644
--- a/network/hostapd/doinst.sh
+++ b/network/hostapd/doinst.sh
@@ -11,12 +11,17 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.hostapd.new:
-if [ -e etc/rc.d/rc.hostapd ]; then
- cp -a etc/rc.d/rc.hostapd etc/rc.d/rc.hostapd.new.incoming
- cat etc/rc.d/rc.hostapd.new > etc/rc.d/rc.hostapd.new.incoming
- mv etc/rc.d/rc.hostapd.new.incoming etc/rc.d/rc.hostapd.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
+}
+
+preserve_perms etc/rc.d/rc.hostapd.new
-config etc/rc.d/rc.hostapd.new