Commit db3c95cd authored by F4BWG's avatar F4BWG

v1.2.0a incl. twitter and activity search

parent 7715187a
#################################################################
# NCurses-Based Bash Menu for BM Master Sysops #
# Version: 1.2.0a #
# Questions/Comments: oli@f4bwg.com #
# Latest Version: #
# https://code.brandmeister.network/F4BWG/NCursesMasterMenu #
......@@ -7,21 +8,29 @@
#################################################################
#!/bin/bash
HEIGHT=15
#### YOU CAN CHANGE THESE SETTINGS ####
HEIGHT=20
WIDTH=40
CHOICE_HEIGHT=6
CHOICE_HEIGHT=12
#MYEDITOR=/usr/bin/vi
MYEDITOR=/usr/bin/emacs
BACKTITLE="BrandMeister Master $(grep -m 1 'network =' /opt/BrandMeister/BrandMeister.conf | grep -E -o '[0-9]+') version $(dpkg --list | grep -i brandmeister | grep -vi registry | awk -F ' ' '{ print $3 }') $(service brandmeister status | grep -i active:)"
TITLE="BM-3021-CA"
#### YOU SHOULD NOT CHANGE THESE SETTINGS####
BACKTITLE="BrandMeister Master $(grep -m 1 'network =' /opt/BrandMeister/BrandMeister.conf | grep -E -o '[0-9]+') version $(dpkg --list | grep -i brandmeister | grep -vi registry | awk -F ' ' '{ print $3 }') $(service brandmeister status | grep -i active:)"
MENU="Choose one of the following options:"
THISFILE=$(readlink -f $0)
OPTIONS=(1 "View BrandMeister Activity"
2 "Edit BrandMeister Config"
3 "Tarantool Console"
4 "Update / Upgrade"
5 "Restart BrandMeister and check"
6 "Check bans")
OPTIONS=( 1 "Realtime BrandMeister Activity"
2 "Search an event"
3 "Edit BrandMeister Config"
4 "TT: Console"
5 "TT: Search Callsign Subscriber"
6 "Update / Upgrade"
7 "Restart BrandMeister and check"
8 "Tweet a text"
9 "Check bans")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
......@@ -35,17 +44,32 @@ clear
case $CHOICE in
1)
tail -f /var/log/syslog ; ~/bm-menu.sh
~/bm-menu.sh
$THISFILE
;;
2)
$MYEDITOR /opt/BrandMeister/BrandMeister.conf
~/bm-menu.sh
read -p "Event to search: " searchit
grep -i brandmeister /var/log/syslog | grep -i $searchit
echo "================= E N D ======================="
read -p "No more result. Press enter to continue"
$THISFILE
;;
3)
tarantoolctl connect /tmp/Registry.sock
~/bm-menu.sh
$MYEDITOR /opt/BrandMeister/BrandMeister.conf
$THISFILE
;;
4)
tarantoolctl connect /tmp/Registry.sock
$THISFILE
;;
5)
echo -e "\n____ Search Callsign in Tarantool Subscribers ____\n"
read -p 'Enter callsign:' callsign
echo "box.space.GlobalLicensees:select{'${callsign^^}'}" | /usr/bin/tarantoolctl connect /tmp/Registry.sock
echo ""
read -n 1 -s -p "Press any key to continue"
$THISFILE
;;
6)
echo " ========================================"
echo " ========> Updating packages"
echo " ========================================"
......@@ -59,16 +83,22 @@ case $CHOICE in
echo " ========================================"
/usr/bin/tarantoolctl restart Registry
echo " ========================================"
read -n1 -r -p "Upgrade process finished..." key
~/bm-menu.sh
read -n1 -r -p "Upgrade process finished. Press a key." key
$THISFILE
;;
5)
7)
systemctl restart brandmeister ; tail -f /var/log/syslog
~/bm-menu.sh
$THISFILE
;;
6)
8)
read -p "Text to tweet: " tweetit
/usr/bin/twidge update "$tweetit"
read -p "Done ! Press enter to continue"
$THISFILE
;;
9)
echo "box.space.StoredBans:select()" | /usr/bin/tarantoolctl connect /tmp/Registry.sock
read -n1 -r -p "End of list..." key
~/bm-menu.sh
$THISFILE
;;
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment