Blob Blame History Raw
diff -up system-switch-mail-1.0.3/system-switch-mail.than system-switch-mail-1.0.3/system-switch-mail
--- system-switch-mail-1.0.3/system-switch-mail.than	2017-11-14 16:14:56.899783915 +0100
+++ system-switch-mail-1.0.3/system-switch-mail	2017-11-14 16:17:38.975671294 +0100
@@ -1,8 +1,18 @@
 #! /bin/sh
 
-if [ -z "$DISPLAY" ] ; then
+SWITCHMAIL_PATH=/usr/share/system-switch-mail
+
+tui() {
 	echo Authentication is needed to run system-switch-mail as super user
-	su -c "/usr/share/system-switch-mail/switchmail_tui.py"
+	su -c "$SWITCHMAIL_PATH/switchmail_tui.py"
+}
+
+if [ -z "$DISPLAY" ] ; then
+	tui
 else
-	/usr/bin/pkexec /usr/share/system-switch-mail/switchmail_gui.py
+	if [ ! -f $SWITCHMAIL_PATH/switchmail_gui.py ] ; then
+		tui
+	else
+		/usr/bin/pkexec $SWITCHMAIL_PATH/switchmail_gui.py
+	fi
 fi