summarylogtreecommitdiffstats
path: root/ucloner.sh
diff options
context:
space:
mode:
authormaz-12015-10-13 10:40:11 +0000
committermaz-12015-10-13 10:40:11 +0000
commit5ce0dd836ff2552c880308c8607d93b91cf90428 (patch)
treefbb57713a67f77ac9605cfae6456fb17cf7a332b /ucloner.sh
parenteabaa1dcfd93f39ab820c312da80d6146ef90798 (diff)
downloadaur-5ce0dd836ff2552c880308c8607d93b91cf90428.tar.gz
init
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 cfda628e0cf..1de575063be 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
+