summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/copyiso2usb4
-rwxr-xr-xcopyiso2usb11
2 files changed, 15 insertions, 0 deletions
diff --git a/bin/copyiso2usb b/bin/copyiso2usb
new file mode 100755
index 0000000..6e89dee
--- /dev/null
+++ b/bin/copyiso2usb
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+pkexec '/usr/sbin/copyiso2usb' "$@"
+
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"}