2 # first look for binary
3 IMCBIN="$(which imc 2> /dev/null)"
4 if [ -z "$IMCBIN" ] ; then
5 echo "Error: no imc found in $PATH"
9 # now search for keys, any other paths?
11 for file in $( find /etc -regex '.*italc.*public/.*\|.*italc.*private/.*' ) ; do
12 if [ ! -d "$file" ] ; then
19 # check if any keys were not found, and create them
20 if [ -z "${name_key[0]}" ] ; then
22 echo "No iTALC keys found, generating keys: $IMCBIN -role teacher -createkeypair"
23 emsg="$( $IMCBIN -role teacher -createkeypair 2>&1 )"
25 #check that createkeypair worked
26 if [ "$?" -gt "0" ] ; then
27 echo "Error generating keys: $emsg"
29 echo "iTALC keys generated successfully." &&
30 #add group and change group assignment
32 chgrp -R italc /etc/italc/keys/private;
33 #chmod 0750 /etc/italc/keys/private/teacher/key;
34 chmod -R 640 /etc/italc/keys/private;
35 chmod -R ug+X /etc/italc/keys/private;
37 # keys were found, show the installer and let them know default paths
39 echo "iTALC keys found: ${name_key[@]}"
40 echo -e "\nNOTE: Default iTALC key locations are: /etc/italc/keys/[public | private]/<role>/key "
41 echo "If your keys are not in these directories, you should move,copy or link them."
44 #postinstall instruction
45 echo "If you are installing on the master (aka teacher) computer, dont forget to add the user to the italc group."
47 # update of the icon cache
48 gtk-update-icon-cache /usr/share/icons/hicolor
57 if [ -d /etc/italc ]; then