diff options
Diffstat (limited to 'system/virtualbox-ose/doinst.sh')
-rw-r--r-- | system/virtualbox-ose/doinst.sh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/system/virtualbox-ose/doinst.sh b/system/virtualbox-ose/doinst.sh index 64d9e36d68..33be91fa14 100644 --- a/system/virtualbox-ose/doinst.sh +++ b/system/virtualbox-ose/doinst.sh @@ -11,6 +11,17 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } +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 [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1 fi @@ -18,12 +29,5 @@ fi # Prepare the new configuration files config etc/vbox/vbox.cfg.new config etc/default/virtualbox.new -for file in etc/rc.d/rc.vboxdrv.new ; do - if [ -e $(dirname $file)/$(basename $file .new) -a -x $(dirname $file)/$(basename $file .new) ]; then - chmod 0755 $file - else - chmod 0644 $file - fi - config $file -done +preserve_perms etc/rc.d/rc.vboxdrv.new |