summaryrefslogtreecommitdiff
path: root/network/hostapd/doinst.sh
diff options
context:
space:
mode:
authorLukenShiro <lukenshiro@ngi.it>2015-04-21 12:02:52 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-04-21 12:02:52 +0700
commita16d4bb87ba4799e3ac7d1515a2830d67e8551f4 (patch)
treeb6d4e79f8b652368633f442ddcfc4aeb03f3016c /network/hostapd/doinst.sh
parent20e12332179cea2b2ed069025219469995f33911 (diff)
downloadslackbuilds-a16d4bb87ba4799e3ac7d1515a2830d67e8551f4.tar.gz
network/hostapd: Updated for version 2.4.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
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