From 6dcbb9b14e4d81b7c4d69bc7978899765ae9bb46 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Mon, 13 Jul 2020 06:41:05 -0700 Subject: [PATCH] script improvements --- radmin | 19 +++++++++---------- rconfig | 15 +++++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/radmin b/radmin index 8809601..f30138b 100755 --- a/radmin +++ b/radmin @@ -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 : Unset the value of (revert to the default value)." - read -p "Please input - omit value to toggle a true/false : " key value + echo "u : Unset the value of (revert to the default value)." + echo + read -p "Please input - 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 " 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 diff --git a/rconfig b/rconfig index 2f96da0..0e1d904 100755 --- a/rconfig +++ b/rconfig @@ -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 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 (revert to the default value)." echo - echo "q : Quit" - echo "u : Unset the value of (revert to the default value)." - read -p "Please input - omit value to toggle a true/false : " key value + read -p "Please input - 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