diff options
Diffstat (limited to 'network/hiawatha/doinst.sh')
-rw-r--r-- | network/hiawatha/doinst.sh | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/network/hiawatha/doinst.sh b/network/hiawatha/doinst.sh index 2242b31cb161..21e47e39984d 100644 --- a/network/hiawatha/doinst.sh +++ b/network/hiawatha/doinst.sh @@ -11,17 +11,14 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.hiawatha.new: -if [ -e etc/rc.d/rc.hiawatha ]; then - cp -a etc/rc.d/rc.hiawatha etc/rc.d/rc.hiawatha.new.incoming - cat etc/rc.d/rc.hiawatha.new > etc/rc.d/rc.hiawatha.new.incoming - mv etc/rc.d/rc.hiawatha.new.incoming etc/rc.d/rc.hiawatha.new -fi - -# Keep same perms on rc.php-fcgi.new: -if [ -e etc/rc.d/rc.php-fcgi ]; then - cp -a etc/rc.d/rc.php-fcgi etc/rc.d/rc.php-fcgi.new.incoming - cat etc/rc.d/rc.php-fcgi.new > etc/rc.d/rc.php-fcgi.new.incoming - mv etc/rc.d/rc.php-fcgi.new.incoming etc/rc.d/rc.php-fcgi.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 +} |