diff options
Diffstat (limited to 'network/dropbear/doinst.sh')
-rw-r--r-- | network/dropbear/doinst.sh | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/network/dropbear/doinst.sh b/network/dropbear/doinst.sh index 0b43865a56cca..9e867318e5d3f 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 |