summaryrefslogtreecommitdiffstats
path: root/copyiso2usb
diff options
context:
space:
mode:
Diffstat (limited to 'copyiso2usb')
-rwxr-xr-xcopyiso2usb11
1 files changed, 11 insertions, 0 deletions
diff --git a/copyiso2usb b/copyiso2usb
index 19127bc..a0fa253 100755
--- a/copyiso2usb
+++ b/copyiso2usb
@@ -42,6 +42,17 @@ Waitmlocate=$(gettext "Running /etc/cron.daily/mlocate.cron. Please wait for 'rc
WaitCopy=$(gettext "Copying iso to usb drive. Please wait for 'rc=0' before continuing.")
FileNameTemp=$(mktemp -p /tmp "${0##*/}".XXXXXX)
+#Check to see if running under pkexec, aka policykit and X
+pktest=${PKEXEC_UID-"unset"}
+if [ ! "unset" = "$pktest" ] ; then
+ mydisplay=$(strings "/proc/$PPID/environ"|grep ^DISPLAY=)
+ myxauthority=$(strings "/proc/$PPID/environ"|grep ^XAUTHORITY=)
+ if [ -n "$mydisplay" ] ; then
+ export DISPLAY=eval "$mydisplay"
+ export XAUTHORITY=eval "$myxauthority"
+ fi
+fi
+
# Set dialog command to use
dialogcmd="/usr/bin/Xdialog"
displaytest=${DISPLAY-"unset"}