diff options
Diffstat (limited to 'system/pcsc-lite/doinst.sh')
-rw-r--r-- | system/pcsc-lite/doinst.sh | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/system/pcsc-lite/doinst.sh b/system/pcsc-lite/doinst.sh index 5086b84736..713fd54d6e 100644 --- a/system/pcsc-lite/doinst.sh +++ b/system/pcsc-lite/doinst.sh @@ -11,11 +11,15 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -if [ -e etc/rc.d/rc.pcscd ]; then - cp -a etc/rc.d/rc.pcscd etc/rc.d/rc.pcscd.new.incoming - cat etc/rc.d/rc.pcscd.new > etc/rc.d/rc.pcscd.new.incoming - mv etc/rc.d/rc.pcscd.new.incoming etc/rc.d/rc.pcscd.new -fi - -config etc/rc.d/rc.pcscd.new +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.pcscd.new |