diff options
author | Robby Workman <rworkman@slackbuilds.org> | 2010-04-23 11:30:34 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2010-04-23 11:30:34 -0500 |
commit | 71113015d28d9178e3d013667c09f12d700345d2 (patch) | |
tree | 008998d87f4bf02f02b4b212a92d1d385e7ebf32 | |
parent | 6f8d5bd58fe1344e4cdf90d96908904611431358 (diff) |
doinst.sh: add preserve_perms() function
-rw-r--r-- | doinst.sh | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -11,14 +11,18 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.INIT.new: -if [ -e etc/rc.d/rc.INIT ]; then - cp -a etc/rc.d/rc.INIT etc/rc.d/rc.INIT.new.incoming - cat etc/rc.d/rc.INIT.new > etc/rc.d/rc.INIT.new.incoming - mv etc/rc.d/rc.INIT.new.incoming etc/rc.d/rc.INIT.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 +} -config etc/rc.d/rc.INIT.new +preserve_perms etc/rc.d/rc.INIT.new config etc/configfile.new if [ -x /usr/bin/update-desktop-database ]; then |