Merging casper 1.199.
[live-boot-grml.git] / scripts / live-bottom / 44pk_allow
index 6ed8d96..fec6401 100755 (executable)
@@ -22,11 +22,12 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Grant administrative PolicyKit pivilieges to default user..."
+log_begin_msg "Grant administrative PolicyKit pivilieges to default user"
 
 # live-initramfs script
 
 # configure PolicyKit in live session
+mkdir -p /root/etc/PolicyKit
 cat << EOF > /root/etc/PolicyKit/PolicyKit.conf
 <?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
 
@@ -39,10 +40,19 @@ cat << EOF > /root/etc/PolicyKit/PolicyKit.conf
        <match user="root">
                <return result="yes"/>
        </match>
+EOF
+
+if [ -n "${USERNAME}" ]
+then
+       cat << EOF >> /root/etc/PolicyKit/PolicyKit.conf
        <!-- don't ask password for user in live session -->
        <match user="$USERNAME">
                <return result="yes"/>
        </match>
+EOF
+fi
+
+cat << EOF >> /root/etc/PolicyKit/PolicyKit.conf
        <define_admin_auth group="admin"/>
 </config>
 EOF