Commit f84b4e51 authored by F4BWG's avatar F4BWG

v1.4

parent 9097be08
==== Version 1.4
+ Added bridge edit
+ Complete redesign of auto-update to avoid empty file when git server is erroring
==== Version 1.3.2
+ Added displaying Tarantool version in the title bar
+ Updated README
......@@ -6,14 +10,12 @@
+ cosmetic revision
==== Version: 1.3.0a
+ Added self-update ability
You can select this option and the script will download/install its latest version.
The current user needs to have write rights to the script
==== Version: 1.2.0a
+ Added a twitting option via twidge
Several master servers have their own twitter account (@bm_3021 @bm2082 etc.)
Requires twidge to be installed and configured in the default folder.
......@@ -25,7 +27,6 @@ This can be helpful if you are looking for an activity from a particular ID, APR
The full pathname is now self-determined
__________________________________________________________
Questions/Comments:
brandmeister@f4bwg.com
#####################################################################################
# NCurses-Based Bash Menu for BM Master Sysops
# Version: 1.3.2
# Version: 1.4
#
# Questions/Comments: oli@f4bwg.com
# Latest Version can be downloaded at:
......@@ -32,27 +32,41 @@
HEIGHT=20
WIDTH=40
CHOICE_HEIGHT=12
#MYEDITOR=/usr/bin/vi
MYEDITOR=/usr/bin/emacs
TITLE="BM-3021-CA"
MYEDITOR=/usr/bin/vi
#MYEDITOR=/usr/bin/emacs
TITLE="BM-XXXX"
#### YOU SHOULD NOT CHANGE ANYTHING BELOW ####
VSCRIPT="1.4"
echo "BM Master Menu v $VSCRIPT"
if [ ! -f $MYEDITOR ]; then
echo "The file editor specified does not exists. Please update configuration !"
echo $MYEDITOR
exit
fi
if [ ! -f /usr/bin/wget ]; then
echo "[WARNING!] wget not installed in your system at /usr/bin/wget . Auto-update feature won't work !"
sleep 2
fi
#### YOU SHOULD NOT CHANGE THESE SETTINGS####
VSCRIPT="1.3.2"
BACKTITLE="($VSCRIPT) 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 }') $(/usr/bin/tarantool -v | grep -i tarantool) $(service brandmeister status | grep -i active:)"
MENU="Choose one of the following options:"
THISFILE=$(readlink -f $0)
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"
10 "Update this script"
3 "Edit BrandMeister Config"
4 "Edit Bridge config"
5 "TT: Console"
6 "TT: Search Callsign Subscriber"
7 "Update / Upgrade"
8 "Restart BrandMeister and check"
9 "Tweet a text"
A "Check bans"
B "Update this script"
)
CHOICE=$(dialog --clear \
......@@ -81,10 +95,14 @@ case $CHOICE in
$THISFILE
;;
4)
tarantoolctl connect /tmp/Registry.sock
$MYEDITOR /opt/BrandMeister/Data/bridge.json
$THISFILE
;;
5)
tarantoolctl connect /tmp/Registry.sock
$THISFILE
;;
6)
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
......@@ -92,7 +110,7 @@ case $CHOICE in
read -n 1 -s -p "Press any key to continue"
$THISFILE
;;
6)
7)
echo " ========================================"
echo " ========> Updating packages"
echo " ========================================"
......@@ -109,24 +127,36 @@ case $CHOICE in
read -n1 -r -p "Upgrade process finished. Press a key." key
$THISFILE
;;
7)
8)
systemctl restart brandmeister ; tail -f /var/log/syslog
$THISFILE
;;
8)
9)
read -p "Text to tweet: " tweetit
/usr/bin/twidge update "$tweetit"
read -p "Done ! Press enter to continue"
$THISFILE
;;
9)
A)
echo "box.space.StoredBans:select()" | /usr/bin/tarantoolctl connect /tmp/Registry.sock
read -n1 -r -p "End of list..." key
$THISFILE
;;
10)
read -p "Current version $VSCRIPT . Press Enter to update"
wget --backups=2 -O $THISFILE https://code.brandmeister.network/F4BWG/NCursesMasterMenu/raw/master/bm-menu.sh
B)
echo ""
read -p "Current version $VSCRIPT . Ensure https://code.brandmeister.network is working, and press Enter to update"
UPDFILE="$THISFILE.update"
OLDFILE="$THISFILE.old"
wget -O $UPDFILE https://code.brandmeister.network/F4BWG/NCursesMasterMenu/raw/master/bm-menu.sh
UPDSIZE=$(stat -c '%s' $UPDFILE)
if [$UPDSIZE -lt 5000]; then
echo "[ERROR!] Update file size inconsistent. Upgrade aborted, no file has changed."
else
mv $THISFILE $OLDFILE
mv $UPDFILE $THISFILE
chmod 755 $THISFILE
echo "Update completed. Previous version saved as $OLDFILE"
fi
$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