Commit 6513ba87 authored by Lior Spach's avatar Lior Spach

le-italc-config: Refs #1372 ica autorun: Modify config before returning

Just to prevent the case ica is already running for some reason.
Signed-off-by: Lior Spach's avatarLior Spach <ls12@inf.ufpr.br>
parent 3d486784
......@@ -161,17 +161,13 @@ generate_script_multiterminal () {
#Create a script in profile.d
local g_file="$SCRIPT_MULT_PATH"
(echo "#!/bin/sh"
(
echo "#!/bin/sh"
echo "#Privileged Users don't run ica"
echo "if [ \"\$USER\" = \"admin\" ]; then"
echo " return 0"
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 "#Resolve Port"
echo "PORT=\"\$(( 11000 + \$(echo \$DISPLAY | awk -F \":\" '{print \$NF}' | cut -b 1) ))\""
echo
......@@ -180,10 +176,16 @@ generate_script_multiterminal () {
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 "fi"
) > $g_file
chmod +x $g_file
}
......
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