From a16d4bb87ba4799e3ac7d1515a2830d67e8551f4 Mon Sep 17 00:00:00 2001 From: LukenShiro Date: Tue, 21 Apr 2015 12:02:52 +0700 Subject: network/hostapd: Updated for version 2.4. Signed-off-by: Willy Sudiarto Raharjo --- network/hostapd/doinst.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'network/hostapd/doinst.sh') 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 -- cgit v1.2.3