Commit de7b5b3e authored by Lior Spach's avatar Lior Spach

le-italc-config: Refs #1372 Untested multiterminal config function added

Signed-off-by: Lior Spach's avatarLior Spach <ls12@inf.ufpr.br>
parent 83b192cf
......@@ -75,11 +75,28 @@ zenity --question --title="Configurador do Italc" \
--text="Verifique as informações: \
\nTipo: $s1 \
\nFunção: $s2" \
--ok-label="Confirma" --cancel-label="Voltar"
--ok-label="Confirma" --cancel-label="Cancelar" ##--cancel-label="Voltar"
[ "$?" = "1" ] && exit 0 #TODO: (NEED: to define directory of this script) execute this script again and exit 0 from this.
##---PROCESS RESULTS---------------------------------------------
generate_script () {
echo "#!/bin/sh" > /etc/profile.d/ica-start-multiterminal.sh
echo "if [ \"\$1\" = \"\" ]; then #means its logOUT" >> /etc/profile.d/ica-start-multiterminal.sh
echo " return 0" >> /etc/profile.d/ica-start-multiterminal.sh
echo "fi" >> /etc/profile.d/ica-start-multiterminal.sh
echo "if [ \"\$USER\" = \"professor\" -o \"\$USER\" = \"admin\" ]; then" >> /etc/profile.d/ica-start-multiterminal.sh
echo " return 0" >> /etc/profile.d/ica-start-multiterminal.sh
echo "fi" >> /etc/profile.d/ica-start-multiterminal.sh
echo "PORT=\"\$(( 11000 + \$(echo \$DISPLAY | cut -b 2) ))\"" >> /etc/profile.d/ica-start-multiterminal.sh
echo "if [ -n \"\$PORT\" ]; then" >> /etc/profile.d/ica-start-multiterminal.sh
echo " ica -port \$PORT &" >> /etc/profile.d/ica-start-multiterminal.sh
echo "fi" >> /etc/profile.d/ica-start-multiterminal.sh
chmod +x /etc/profile.d/ica-start-multiterminal.sh
}
config_client_monoterminal () {
#Steps:
## 1. Ask for keys
......@@ -125,10 +142,20 @@ config_master_monoterminal () {
}
config_client_multiterminal () {
return
config_master_multiterminal
}
config_master_multiterminal () {
return
//Generate public and private keys
imc -role teacher -createkeypair
#Protect private keys
chown $SUDO_USER /etc/italc/keys/ -R
sudo -u $SUDO_USER chmod 700 /etc/italc/keys/private -R
#Release public key
sudo -u $SUDO_USER chmod 755 /etc/italc/keys/public -R
generate_script
}
#Call right configuration function
......@@ -139,11 +166,11 @@ if [ "$isMult" = "0" ]; then
config_master_monoterminal
fi
elif [ "$isMult" = "1" ]; then
if [ "$isClient" = "1" ]; then
config_client_multiterminal
else
#if [ "$isClient" = "1" ]; then
# config_client_multiterminal
#else
config_master_multiterminal
fi
#fi
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