script improvements

pull/1/head
Tom Early 6 years ago
parent d581c96dbc
commit 6dcbb9b14e

@ -99,11 +99,6 @@ Compile () {
# Execution starts here!
# file locations
rcfg='reflector.cfg'
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'
@ -144,8 +139,9 @@ do
echo "rr : Restart reflector"
echo "rt : Restart transcoder"
else
echo "cl : Clean objects and executables"
echo "co : Compile executable(s)"
echo "cl : Clean (remove) compiled objects and executables"
echo "gp : Pull the latest software from the repo"
echo "co : Compile system executable(s)"
if [[ "$callsign" == XRF* ]] || [[ "$callsign" == XLX* ]]; then
if [[ "$callsign" == XRF* ]] && [ -e src/xrfd ]; then
echo "is : Install XRF reflector"
@ -162,14 +158,17 @@ do
fi
echo
echo "q : Quit"
echo "u <key> : Unset the value of <key> (revert to the default value)."
read -p "Please input <key> <value> - omit value to toggle a true/false : " key value
echo "u : Unset the value of <key> (revert to the default value)."
echo
read -p "Please input <key> <value> - omit value to toggle a true/false : " key value garbage
if [[ "$key" == ls* ]]; then
cat reflector.cfg;
read -p "Enter to return: " ans
ceho
read -p "<Enter> to return to main menu: " ans
elif [[ "$key" == us* ]]; then UninstallReflector
elif [[ "$key" == is* ]]; then InstallReflector
elif [[ "$key" == gp* ]]; then git pull
elif [[ "$key" == rr* ]]; then
if [[ "$callsign" == XLX* ]]
then sudo systemctl restart xlxd

@ -162,6 +162,8 @@ WriteCFGFiles () {
ListCFGFiles ()
{
echo "===========${rcfg}============="
cat $rcfg
echo "===========${srch}============="
cat $srch
echo "===========${srcm}============="
@ -172,7 +174,6 @@ ListCFGFiles ()
echo "===========${ambm}============="
cat $ambm
fi
read -p "Press <return> to continue: " ans
}
# Execution starts here!
@ -218,15 +219,16 @@ do
fi
echo -n "g3 : Icom G3 Support = "; EvaluateVar g3support{,_d}
echo -n "db : Debugging Support = "; EvaluateVar dbsupport{,_d}
echo
if [[ "$callsign" == XLX* ]] || [[ "$callsign" == XRF* ]]; then
echo "w : Write configuration filess (overwrites any existing files)"
echo "w : Write configuration files (overwrites any existing files) and quit"
fi
echo "q : Quit without saving"
echo "u : Unset the value of <key> (revert to the default value)."
echo
echo "q : Quit"
echo "u <key> : Unset the value of <key> (revert to the default value)."
read -p "Please input <key> <value> - omit value to toggle a true/false : " key value
read -p "Please input <key> <value> - omit value to toggle a true/false : " key value garbage
if [[ "$key" == cs* ]]; then
if [[ "$key" == cs* && ( ${value^^} == XRF* || ${value^^} == XLX* ) ]]; then
callsign="${value^^}"
callsign="${callsign:0:6}"
if [[ "$callsign" == REF* ]]; then
@ -242,6 +244,7 @@ do
elif [[ "$key" == w* ]]; then
WriteCFGFiles
ListCFGFiles
exit 0
elif [[ "$key" == u* ]]; then
if [[ "$value" == cs* ]]; then unset callsign
elif [[ "$value" == nm* ]]; then unset nummod

Loading…
Cancel
Save

Powered by TurnKey Linux.