Commit 15874b8a authored by Dalmon Ian Martins de Oliveira's avatar Dalmon Ian Martins de Oliveira

Merge branch 'master' of git.c3sl.ufpr.br:./le5/unstable

parents 62db7cd4 e2f13daf
Package: le-italc-config
Version: 0.0.16
Version: 0.0.18
Description: Italc Auto Configuration Tool for Linux Educacional
Priority: optional
Section: misc
......
......@@ -112,5 +112,5 @@ Se os terminais estão logados como alunos, deve ser possível ver as telas dos
</P>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -\-target html ./doc/help.t2t -->
<!-- cmdline: txt2tags -\-target html ../bin/../le-italc-config/doc/help.t2t -->
</BODY></HTML>
......@@ -159,38 +159,34 @@ generate_script_monoterminal_client () {
generate_script_multiterminal () {
#Create a script in profile.d
local g_file="$SCRIPT_MULT_PATH"
echo "#!/bin/sh" > $g_file
echo "#Privileged Users don't run ica" >> $g_file
echo "if [ \"\$USER\" = \"admin\" ]; then" >> $g_file
echo " return 0" >> $g_file
echo "fi" >> $g_file
echo "#Do not execute ica on logout" >> $g_file
echo "if ps -u \$USER -o comm | grep \"^ica\$\"; then" >> $g_file
echo " return 0" >> $g_file
echo "fi" >> $g_file
echo "#Resolve Port" >> $g_file
echo "PORT=\"\$(( 11000 + \$(echo \$DISPLAY | awk -F \":\" '{print \$NF}' | cut -b 1) ))\"" >> $g_file
(
echo "#!/bin/sh"
echo "#Privileged Users don't run ica"
echo "if [ \"\$USER\" = \"admin\" ]; then"
echo " return 0"
echo "fi"
echo
echo "#Resolve Port"
echo "PORT=\"\$(( 11000 + \$(echo \$DISPLAY | awk -F \":\" '{print \$NF}' | cut -b 1) ))\""
echo
echo "#ReSet the default port server for teacher(mobility to teachers computer)"
echo "if [ \"\$USER\" = \"professor\" ]; then"
echo " italc_conf=\"/etc/xdg/iTALC Solutions/iTALC.conf\""
echo " if [ -e \"italc_conf\" ]; then #if file exist\""
echo " line=\$(sed -n '/CoreServerPort=/=' \"\$italc_conf\")"
echo " sed -i \"/CoreServerPort=/d\" \"\$italc_conf\""
echo " sed -i \"\${line}iCoreServerPort=\${PORT}\" \"\$italc_conf\""
echo " fi"
echo " imc -setconfigvalue Network/CoreServerPort=\${PORT}"
echo "fi"
echo
echo "#Do not execute ica on logout"
echo "if ps -u \$USER -o comm | grep \"^ica\$\"; then"
echo " return 0"
echo "fi"
echo
echo "#Execute ICA"
echo "if [ -n \"\$PORT\" ]; then"
echo " ica -port \$PORT &"
echo "fi"
) > $g_file
echo "#Execute ICA" >> $g_file
echo "if [ -n \"\$PORT\" ]; then" >> $g_file
echo " ica -port \$PORT &" >> $g_file
echo "fi" >> $g_file
chmod +x $g_file
}
......@@ -253,11 +249,15 @@ config_multiterminal () {
#Release public key
sudo -u professor chmod 755 /etc/italc/keys/public -R
imc -setconfigvalue Authentication/LogonAuthenticationEnabled=0 #Don't ask for login to enter italc
generate_script_multiterminal #ica autorun
if (who --users | awk -F " " '{print $1}' | grep -q "^professor$"); then #If teacher is logged in execute ica(no need for relogin)
su professor -c "ica & disown"
#Set config and create autorun script
imc -setconfigvalue Authentication/LogonAuthenticationEnabled=0 #Don't ask for login to enter italc. Only teacher can read private key.
generate_script_multiterminal
#Give professor right to write to configuration file.
chown professor /etc/xdg/iTALC\ Solutions/iTALC.conf
chmod 0600 /etc/xdg/iTALC\ Solutions/iTALC.conf
if (who --users | awk -F " " '{print $1}' | grep -q "^professor$"); then #If teacher is logged in execute autorun script
su professor -c ".${SCRIPT_MULT_PATH}" #Run script, so teacher doesn't need to relogin
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment