bootrecover: more fixes for running as user instead of root

This commit is contained in:
Silvan Calarco 2011-11-07 01:15:55 +01:00
parent 008406b577
commit 7ca6abed3f
4 changed files with 17 additions and 10 deletions

View File

@ -305,7 +305,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Copyright (c) 2007-2010 by Silvan Calarco <string>Copyright (c) 2007-2011 by Silvan Calarco
Released under the terms of the GNU GPL v3 license</string> Released under the terms of the GNU GPL v3 license</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
@ -1115,7 +1115,7 @@ _EOF
@if (@confirmBox.checked); then @if (@confirmBox.checked); then
@dcop(@dcopid, KommanderIf, setEnabled(QString,bool), back, false) @dcop(@dcopid, KommanderIf, setEnabled(QString,bool), back, false)
@exec("sudo /usr/share/openmamba/bootrecover/bootrecover.sh -y @dcopid &amp;&gt; ~/.bootrecover.log") @exec("sudo /usr/share/openmamba/bootrecover/bootrecover.sh ~/.bootrecover.conf @dcopid `whoami` &amp;&gt; ~/.bootrecover.log")
@execBegin @execBegin
dcop @dcopid KommanderIf setText installlog "`cat ~/.bootrecover.log`" dcop @dcopid KommanderIf setText installlog "`cat ~/.bootrecover.log`"
@execEnd @execEnd

View File

@ -3,11 +3,10 @@
# #
# Released under the terms of the GNU GPLv3 License # Released under the terms of the GNU GPLv3 License
VERSION=0.6 VERSION=0.7
TEXTDOMAIN=bootrecover TEXTDOMAIN=bootrecover
TEXTDOMAINDIR=/opt/kde3/share/locale/ TEXTDOMAINDIR=/opt/kde3/share/locale/
INSTALL_DATE=`date +%Y%m%d-%H%M` INSTALL_DATE=`date +%Y%m%d-%H%M`
INPUT_FILE=~/.bootrecover.conf
LOG_FILE=/var/log/bootrecover-$INSTALL_DATE.log LOG_FILE=/var/log/bootrecover-$INSTALL_DATE.log
MOUNTPOINT=/mnt/install MOUNTPOINT=/mnt/install
KERNEL_RELEASE=`uname -r` KERNEL_RELEASE=`uname -r`
@ -72,15 +71,23 @@ Installation time: $TIME_ELAPSED minutes"
done done
} }
DCOPID=$2 export PATH=$PATH:/sbin:/usr/sbin:/opt/kde3/bin
INPUT_FILE=$1
[ "$2" -a "$3" ] && DCOPID="--user $3 $2"
echo $"\ echo $"\
openmamba boot loader recovery script - version $VERSION openmamba boot loader recovery script - version $VERSION
Copyright (c) 2007-2010 by Silvan Calarco <silvan.calarco@mambasoft.it> Copyright (c) 2007-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
" "
dcop_write $"Starting installation..." 5 dcop_write $"Starting installation..." 5
[ $INPUT_FILE ] || {
echo $"Error: this script must be called by bootloader.kmdr; aborting." >&2
abort
}
[ -r $INPUT_FILE ] || { [ -r $INPUT_FILE ] || {
echo $"Error: cannot read input file $INPUT_FILE; aborting." >&2 echo $"Error: cannot read input file $INPUT_FILE; aborting." >&2
abort abort

View File

@ -44,9 +44,9 @@ msgstr ""
#: _from_rc.cc:12 #: _from_rc.cc:12
msgid "" msgid ""
"Copyright (c) 2007-2010 by Silvan Calarco\n" "Copyright (c) 2007-2011 by Silvan Calarco\n"
"Released under the terms of the GNU GPL v3 license" "Released under the terms of the GNU GPL v3 license"
msgstr "Copyright (c) 2007-2010 by Silvan Calarco\n" msgstr "Copyright (c) 2007-2011 by Silvan Calarco\n"
"Expedido según los terminos de la licencia GNU GPL v3" "Expedido según los terminos de la licencia GNU GPL v3"
#: _from_rc.cc:9 #: _from_rc.cc:9

View File

@ -44,9 +44,9 @@ msgstr ""
#: _from_rc.cc:12 #: _from_rc.cc:12
msgid "" msgid ""
"Copyright (c) 2007-2010 by Silvan Calarco\n" "Copyright (c) 2007-2011 by Silvan Calarco\n"
"Released under the terms of the GNU GPL v3 license" "Released under the terms of the GNU GPL v3 license"
msgstr "Copyright (c) 2007-2010 by Silvan Calarco\n" msgstr "Copyright (c) 2007-2011 by Silvan Calarco\n"
"Rilasciato secondo i termini della licenza GNU GPL v3" "Rilasciato secondo i termini della licenza GNU GPL v3"
#: _from_rc.cc:9 #: _from_rc.cc:9