[debian-edu-commits] debian-edu/italc.git (#109) - master (branch) updated: debian/1_2.0.0-3-11-gc6e09b2

Mike Gabriel sunweaver at alioth.debian.org
Mon Aug 12 01:32:56 UTC 2013


The branch, master has been updated
       via  c6e09b24cf7f601c68cde4b1aafabdd4bcb6b677 (commit)
      from  ec2129942a46aa8e119ad76db4771518a00f3de0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c6e09b24cf7f601c68cde4b1aafabdd4bcb6b677
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Aug 12 02:12:18 2013 +0200

    fix postinst script of italc-client

-----------------------------------------------------------------------

Summary of changes:
 debian/italc-client.postinst |  138 ++++++++++++++++++++++--------------------
 1 file changed, 71 insertions(+), 67 deletions(-)

The diff of changes is:
diff --git a/debian/italc-client.postinst b/debian/italc-client.postinst
index 1d752b3..fc5423d 100755
--- a/debian/italc-client.postinst
+++ b/debian/italc-client.postinst
@@ -36,43 +36,92 @@ case "$1" in
 
 		# users of iTALC master
 
-		for role in admin supporter teacher; do
+		if [ "$italc_create_keypairs" = "true" ]; then
 
-			db_get italc-client/del-last-group-$role
+			for role in admin supporter teacher; do
+
+				db_get italc-client/del-last-group-$role
+				del_last_group="$RET"
+				if [ "$del_last_group" = "true" ]; then
+					db_get italc-client/last-group-$role
+					last_group=$(echo $RET | cut -d" " -f1)
+
+					# try to remove the formerly used group for this role, on failure, ignore it
+					getent group $last_group 1>/dev/null && delgroup "$last_group" || \
+					    echo "Removing Posix group »$last_group« for role »$role« failed."
+
+				fi
+
+				db_get italc-client/group-italc-$role
+				# for sanity: we take everything as a group name until we fine a blank...
+				group=$(echo $RET | cut -d" " -f1)
+
+				if ! getent group "$group" 1>/dev/null; then
+					if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
+						group=""
+					fi
+				fi
+
+				if [ "$italc_create_keypairs" = "true" ]; then
+					if ! test -f "/etc/italc/keys/public/$role/key" -a -f "/etc/italc/keys/private/$role/key"; then
+						echo -n "Creating iTALC public/private key pair for iTALC role »$role« ... "
+						imc -role $role -createkeypair >/dev/null 2>/dev/null
+						echo "done."
+					else
+						echo "iTALC public/private key for iTALC role »$role« already exists."
+					fi
+				fi
+
+				echo italc_create_groups_for_roles: $italc_create_groups_for_roles $group
+				if [ "$italc_create_groups_for_roles" = "true" ] && [ "x$group" != "x" ]; then
+					if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
+						echo "Specified group for role »$role« is a gidNumber, not creating any group." 1>&2
+					elif ! getent group $group >/dev/null; then
+						echo "Creating $group group." 1>&2
+						addgroup --system $group
+					else
+						echo "Group »$group« already exists." 1>&2
+					fi
+				fi
+
+				if [ "$italc_key_access_for_groups" = "true" ]; then
+					if ! test -f "/etc/italc/keys/private/$role/key"; then 
+						if [ "x$group" != "x" ]; then
+							chown -Rf :$group "/etc/italc/keys/private/$role"
+						else
+							chown -Rf :root "/etc/italc/keys/private/$role"
+						fi
+					fi
+				fi
+			done
+
+			# users of iTALC client
+
+			db_get italc-client/del-last-group-student
 			del_last_group="$RET"
 			if [ "$del_last_group" = "true" ]; then
-				db_get italc-client/last-group-$role
+				db_get italc-client/last-group-student
 				last_group=$(echo $RET | cut -d" " -f1)
 
 				# try to remove the formerly used group for this role, on failure, ignore it
-				getent group last_group 1>/dev/null && delgroup "$last_group" || \
-				    echo "Removing Posix group »$last_group« for role »$role« failed."
+				getent group $last_group 1>/dev/null && delgroup "$last_group" || \
+				    echo "Removing Posix group »$last_group« for role »student« failed."
 
 			fi
 
-			db_get italc-client/group-italc-$role
+			db_get italc-client/group-italc-student
 			# for sanity: we take everything as a group name until we fine a blank...
 			group=$(echo $RET | cut -d" " -f1)
 
 			if ! getent group "$group" 1>/dev/null; then
-				if echo "$group" | egrep -v '^[[:digit:]]{1,5}$' 1>/dev/null; then
+				if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
 					group=""
 				fi
 			fi
 
-			if [ "$italc_create_keypairs" = "true" ]; then
-				if ! test -f "/etc/italc/keys/public/$role/key" -a -f "/etc/italc/keys/private/$role/key"; then
-					echo -n "Creating iTALC public/private key pair for iTALC role »$role« ... "
-					imc -role $role -createkeypair >/dev/null 2>/dev/null
-					echo "done."
-				else
-					echo "iTALC public/private key for iTALC role »$role« already exists."
-				fi
-			fi
-
-			if [ "$italc_create_groups_for_roles" = "true" ] && [ "x$group" != "x" ]; then
+			if [ "$italc_create_groups_for_roles" = "true" ]; then
 				if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
-					echo "Specified group for role »$role« is a gidNumber, not creating any group." 1>&2
+					echo "Specified group for role »student« is a gidNumber, not creating any group." 1>&2
 				elif ! getent group $group >/dev/null; then
 					echo "Creating $group group." 1>&2
 					addgroup --system $group
@@ -82,60 +131,15 @@ case "$1" in
 			fi
 
 			if [ "$italc_key_access_for_groups" = "true" ]; then
-				if ! test -f "/etc/italc/keys/private/$role/key"; then 
+				if ! test -f "/etc/italc/keys/public/$role/key"; then
 					if [ "x$group" != "x" ]; then
-						chown -Rf :$group "/etc/italc/keys/private/$role"
+						chown -Rf :$group "/etc/italc/keys/public/*"
 					else
-						chown -Rf :root "/etc/italc/keys/private/$role"
+						chown -Rf :root "/etc/italc/keys/public/*"
 					fi
 				fi
 			fi
 
-		done
-
-		# users of iTALC client
-
-		db_get italc-client/del-last-group-student
-		del_last_group="$RET"
-		if [ "$del_last_group" = "true" ]; then
-			db_get italc-client/last-group-student
-			last_group=$(echo $RET | cut -d" " -f1)
-
-			# try to remove the formerly used group for this role, on failure, ignore it
-			getent group last_group 1>/dev/null && delgroup "$last_group" || \
-			    echo "Removing Posix group »$last_group« for role »student« failed."
-
-		fi
-
-		db_get italc-client/group-italc-student
-		# for sanity: we take everything as a group name until we fine a blank...
-		group=$(echo $RET | cut -d" " -f1)
-
-		if ! getent group "$group" 1>/dev/null; then
-			if echo "$group" | egrep -v '^[[:digit:]]{1,5}$' 1>/dev/null; then
-				group=""
-			fi
-		fi
-
-		if [ "$italc_create_groups_for_roles" = "true" ]; then
-			if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
-				echo "Specified group for role »student« is a gidNumber, not creating any group." 1>&2
-			elif ! getent group $group >/dev/null; then
-				echo "Creating $group group." 1>&2
-				addgroup --system $group
-			else
-				echo "Group »$group« already exists." 1>&2
-			fi
-		fi
-
-		if [ "$italc_key_access_for_groups" = "true" ]; then
-			if ! test -f "/etc/italc/keys/public/$role/key"; then
-				if [ "x$group" != "x" ]; then
-					chown -Rf :$group "/etc/italc/keys/public/*"
-				else
-					chown -Rf :root "/etc/italc/keys/public/*"
-				fi
-			fi
 		fi
 		;;
 


hooks/post-receive
-- 
italc.git (Debian package italc)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "italc.git" (Debian package italc).




More information about the debian-edu-commits mailing list