better script protections

pull/1/head
Tom Early 6 years ago
parent a198706125
commit ccb4e6e960

@ -128,7 +128,7 @@ do
ps -aux | grep -e xlxd -e xrfd -e ambed | grep -v grep
fi
echo
echo " Reflector Administration, Version #200713"
echo " Reflector Administration, Version #200715"
echo
echo "ls : List the configuration file"
echo "cl : Clean (remove) compiled objects and executables"
@ -176,18 +176,29 @@ do
cat reflector.cfg;
echo
read -p "<Enter> to return to main menu: " ans
elif [[ "$key" == us* ]]; then UninstallReflector
elif [[ "$key" == is* ]]; then InstallReflector
elif [[ "$key" == us* ]]; then
if [[ "$callsign" == XLX* ]] && [ -e $xlxserv ]; then
UninstallReflector
elif [[ "$callsign" == XRF* ]] && [ -e $xrfserv ]; then
UninstallReflector
fi
elif [[ "$key" == is* ]]; then
if [[ "$callsign" == XLX* ]] && [ -e src/xlxd ] && [ ! -e $xlxserv ] && [ ! -e $xrfserv ]; then
InstallReflector
elif [[ "$callsign" == XRF* ]] && [ -e src/xrfd ] && [ ! -e $xlxserv ] && [ ! -e $xrfserv ]; then
InstallReflector
fi
elif [[ "$key" == gp* ]]; then git pull
elif [[ "$key" == rr* ]]; then
if [[ "$callsign" == XLX* ]]
then sudo systemctl restart xlxd
else sudo systemctl restart xrfd
if [[ "$callsign" == XLX* ]] && [ -e $xlxserv ]; then
sudo systemctl restart xlxd
elif [[ "$callsign" == XRF* ]] && [ -e $xrfserv ]; then
sudo systemctl restart xrfd
fi
elif [[ "$key" == rt* ]]; then sudo systemctl restart ambed
elif [[ "$key" == rt* ]] && [ -e $ambserv ]; then sudo systemctl restart ambed
elif [[ "$key" == cl* ]]; then Clean
elif [[ "$key" == co* ]]; then Compile
elif [[ "$key" == tl* ]]; then sudo journalctl -u ambed -f
elif [[ "$key" == tl* ]] && [ -e $ambserv ]; then sudo journalctl -u ambed -f
elif [[ "$key" == rl* ]]; then
if [ -e $xlxserv ]; then
sudo journalctl -u xlxd -f

@ -183,6 +183,8 @@ srch='src/configure.h'
srcm='src/configure.mk'
ambh='ambed/configure.h'
ambm='ambed/configure.mk'
xlxserv='/etc/systemd/system/xlxd.service'
xrfserv='/etc/systemd/system/xrfd.service'
# default values
callsign_d='CHNGME'
nummod_d=26
@ -199,13 +201,28 @@ else
echo 'No configuration file found...'
sleep 1
fi
if [ -e $xlxserv ] || [ -e $xrfserv ]; then
echo -n "You cannot change the configuration right now beacuse there is an "
if [ -e $xlxserv ]; then
echo "XLX server running."
else
echo "XRF server running."
fi;
echo "===========${rcfg}============="
cat $rcfg
echo
echo "Please use radmin to uninstall the running server before attempting to modify the configuration."
exit 1
fi
key='x'
# main loop
while [[ "$key" != q* ]]
do
clear
echo
echo " Reflector Configuration, Version #200713"
echo " Reflector Configuration, Version #200715"
echo
echo -n "cs : Reflector Callsign = "; EvaluateVar callsign{,_d}
echo -n "nm : Number of Modules = "; EvaluateVar nummod{,_d}

Loading…
Cancel
Save

Powered by TurnKey Linux.