[debian-edu-commits] debian-edu/ 02/04: debian/bin/ica (wrapper): When the -autostart cmdline arg is given, launch iTALC client with the most privileged role that is available to the current user.

Mike Gabriel sunweaver at debian.org
Sun Oct 5 22:41:20 UTC 2014


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository italc.

commit 3cf832083d80a5f6b9298a13fe5a58d6fcfc83d2
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Oct 5 16:25:21 2014 +0200

    debian/bin/ica (wrapper): When the -autostart cmdline arg is given, launch iTALC client with the most privileged role that is available to the current user.
---
 debian/bin/ica | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/debian/bin/ica b/debian/bin/ica
index 83dd25f..73346b5 100755
--- a/debian/bin/ica
+++ b/debian/bin/ica
@@ -35,11 +35,23 @@ fi
 # will not display any GUI error messages...
 if [ "x$1" = "x-autostart" ]; then
 	shift
-	AUTOSTART="true"
+	ITALC_AUTOSTART="true"
 fi
 
-if test -x /etc/italc/keys/public; then
-	/usr/lib/italc/ica "$@" &
+if [ -x /etc/italc/keys/public ]; then
+	if [ "x$ITALC_AUTOSTART" = "xtrue" ]; then
+		if [ -r /etc/italc/keys/private/admin/key ]; then
+			/usr/lib/italc/ica "$@" -role admin &
+		elif [ -r /etc/italc/keys/private/supporter/key ]; then
+			/usr/lib/italc/ica "$@" -role supporter &
+		elif [ -r /etc/italc/keys/private/teacher/key ]; then
+			/usr/lib/italc/ica "$@" -role teacher &
+		else
+			/usr/lib/italc/ica "$@" -role other &
+		fi
+	else
+		/usr/lib/italc/ica "$@" &
+	fi
 else
 
 	if [ -z "$DISPLAY" ]; then
@@ -51,9 +63,9 @@ else
 		echo
 		echo "Exiting..."
 		echo
-	elif type kdialog 1>/dev/null && [ "x$AUTOSTART" != "xtrue" ]; then
+	elif type kdialog 1>/dev/null && [ "x$ITALC_AUTOSTART" != "xtrue" ]; then
 		kdialog --title "iTALC Client" --error "$MSG"
-	elif type zenity 1>/dev/null && [ "x$AUTOSTART" != "xtrue" ]; then
+	elif type zenity 1>/dev/null && [ "x$ITALC_AUTOSTART" != "xtrue" ]; then
 		zenity --title "iTALC Client" --error --text "$MSG"
 	else
 		echo

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/italc.git



More information about the debian-edu-commits mailing list