aboutsummaryrefslogtreecommitdiff
path: root/network/dropbear/doinst.sh
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-03-19 14:07:31 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-03-19 14:07:31 +0700
commit148624f67ce49366081b9c586b3c42d48ba57c5e (patch)
treec96c7bb4c178cdcac37c3721cbd0c2b957d76551 /network/dropbear/doinst.sh
parent7b7b9234f14a43999aa83340383c2a6726ace3b3 (diff)
network/dropbear: Updated for version 2016.73.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/dropbear/doinst.sh')
-rw-r--r--network/dropbear/doinst.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/network/dropbear/doinst.sh b/network/dropbear/doinst.sh
index 0b43865a56cc..9e867318e5d3 100644
--- a/network/dropbear/doinst.sh
+++ b/network/dropbear/doinst.sh
@@ -10,18 +10,23 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.dropbear.new:
-if [ -e etc/rc.d/rc.dropbear ]; then
- cp -a etc/rc.d/rc.dropbear etc/rc.d/rc.dropbear.new.incoming
- cat etc/rc.d/rc.dropbear.new > etc/rc.d/rc.dropbear.new.incoming
- mv etc/rc.d/rc.dropbear.new.incoming etc/rc.d/rc.dropbear.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
+}
if [ -e usr/bin/scp ]; then
mv usr/bin/scp usr/bin/scp.openssh
fi
config etc/rc.d/rc.dropbear.new
+preserve_perms etc/rc.d/rc.dropbear.new
# Create a logfile if one doesn't already exist
if [ ! -e var/log/dropbear.log ]; then