<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
+mkdir -p /root/var/lib/polkit-1/localauthority/10-vendor.d
+cat << EOF > /root/var/lib/polkit-1/localauthority/10-vendor.d/10-live-cd.pkla
+# Policy to allow the livecd user to bypass policykit
+[Live CD user permissions]
+Identity=unix-user:$USERNAME
+Action=*
+ResultAny=no
+ResultInactive=no
+ResultActive=yes
+EOF
+
log_end_msg