summarylogtreecommitdiffstats
path: root/ucloner.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ucloner.sh')
-rw-r--r--ucloner.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/ucloner.sh b/ucloner.sh
index cfda628e0cf8..1de575063be4 100644
--- a/ucloner.sh
+++ b/ucloner.sh
@@ -1,14 +1,26 @@
#!/bin/sh
export LANGUAGE=`echo $LANG | grep -oP [A-Za-z_]+ | head -1`
-which sudo 2>&1 > /dev/null && SUPER=sudo
-which gksu 2>&1 > /dev/null && SUPER=gksu
-which kdesu 2>&1 > /dev/null && SUPER=kdesu
-
if [ "$( ps -A | grep ucloner_gui)" ] ; then
zenity --title="Error" --error --text="Another uclone instance is running!"
exit 1
fi
cd /opt/ucloner/
-exec $SUPER python2 ./ucloner_gui.py \ No newline at end of file
+
+which sudo && SUPER="sudo"
+which gksu && SUPER="gksu"
+which kdesu && SUPER="kdesu"
+
+case $SUPER in
+"kdesu")
+exec kdesu -c "python2 ./ucloner_gui.py"
+;;
+"gksu")
+exec gksu python2 ./ucloner_gui.py
+;;
+"sudo")
+exec sudo python2 ./ucloner_gui.py
+;;
+esac
+