From ae1e686e8fdbbc8c2d15d8baad1f26cc0b8fbe92 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 8 Mar 2023 11:54:14 -0700 Subject: [PATCH] improved radmin --- README.md | 4 ++-- radmin | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 633c679..95dbb5c 100644 --- a/README.md +++ b/README.md @@ -135,10 +135,10 @@ One at a time, *dbutil* can work with any of the three DATABASEs. It can read ei After you have written your configutation files, you can install your system: ```bash -./radmin +./radmin ``` -Use can use this interactive shell script to install and uninstall your system. This can also perform other tasks like restarting the reflector or transcoder process, or be used to view the reflector or transcoder log in real time. +You can use this interactive shell script to install and uninstall your system. This can also perform other tasks like restarting the reflector or transcoder process, or be used to view the reflector or transcoder log in real time. ### Stoping and starting the services manually diff --git a/radmin b/radmin index 60f6591..ba8f9be 100755 --- a/radmin +++ b/radmin @@ -76,8 +76,14 @@ if [[ $# -eq 1 ]]; then exit 1 fi else - echo "Usage: ./radmin inifilename" - exit 1 + if [[ -e reflector/urfd.ini ]]; then + callsign=$(awk '$1 == "Callsign"{print $3}' reflector/urfd.ini) + tcaddress=$(awk '$1 == "Transcoder"{print $3}' reflector/urfd.ini) + else + echo "ERROR: could not find reflector/urfd.ini! You'll have to specify it." + echo "Usage: ./radmin PATH-TO-INI-FILE" + exit 1 + fi fi key='x' # main loop @@ -91,11 +97,10 @@ do ps -aux | grep -e urfd -e tcd | grep -v grep | grep -v radmin fi echo - echo " Reflector Administration, Version #230221" + echo " Reflector Administration, Version #230308" echo git status | head -1 echo - echo "ls : List the configuration file" if [ -e $urfserv ]; then if [ -e $urfserv ]; then echo "us : Uninstall the URF reflector" @@ -126,11 +131,7 @@ do echo read -p "Please input - omit value to toggle a true/false : " key value garbage - if [[ "$key" == ls* ]]; then - cat reflector.cfg; - echo - read -p " to return to main menu: " ans - elif [[ "$key" == us* ]]; then + if [[ "$key" == us* ]]; then if [ -e $urfserv ]; then UninstallReflector fi @@ -138,10 +139,7 @@ do if [ -e reflector/urfd ] && [ ! -e $urfserv ]; then InstallReflector fi - elif [[ "$key" == rr* ]]; then - if [ -e $urfserv ]; then - sudo systemctl restart urfd - fi + elif [[ "$key" == rr* ]] && [ -e $urfserv ]; then sudo systemctl restart urfd elif [[ "$key" == tr* ]] && [ -e $tcdserv ]; then sudo systemctl restart tcd elif [[ "$key" == tl* ]] && [ -e $tcdserv ]; then sudo journalctl -u tcd -f elif [[ "$key" == rl* ]] && [ -e $urfserv ]; then sudo journalctl -u urfd -f