I'm trying to write a very simple script to check whether iptables are already updated for Synergy to work. The current script is:
if [[ $SYNERGY = "yes" ]]
then
echo "Synergy is active"
else
sudo iptables -I INPUT -p tcp --dport 24800 -j ACCEPT
export SYNERGY=yes
fi
But it does not work (I'm always asked for the sudo password each time I open a new terminal)
I also tried with this modified version, but the result is the same
syn="yes"
if [ "$SYNERGY" = "$syn" ]
then
echo "Synergy is active"
else
sudo iptables -I INPUT -p tcp --dport 24800 -j ACCEPT
export SYNERGY=yes
fi
Where is the issue?
SYNERGYvariable getting set?sudo iptables -I INPUT -p tcp --dport 24800 -j ACCEPT