diff options
author | Dave Hodgins <davidwhodgins@mageia.org> | 2013-10-07 17:53:10 -0400 |
---|---|---|
committer | Dave Hodgins <davidwhodgins@mageia.org> | 2013-10-07 17:53:10 -0400 |
commit | 728a9286a154352d84c1d063421408fbeb3c5cb6 (patch) | |
tree | 845a2f9aa62a4ef47888f7e4de6f4e69d264c5e5 | |
parent | bd05f1c7d2fa1d2c8d7c3eb5e103f675fac6cde4 (diff) | |
download | copyiso2usb-728a9286a154352d84c1d063421408fbeb3c5cb6.tar copyiso2usb-728a9286a154352d84c1d063421408fbeb3c5cb6.tar.gz copyiso2usb-728a9286a154352d84c1d063421408fbeb3c5cb6.tar.bz2 copyiso2usb-728a9286a154352d84c1d063421408fbeb3c5cb6.tar.xz copyiso2usb-728a9286a154352d84c1d063421408fbeb3c5cb6.zip |
Switch to using pkexec instead of consolehelper
-rwxr-xr-x | bin/copyiso2usb | 4 | ||||
-rwxr-xr-x | copyiso2usb | 11 |
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"} |