Commit 9097be08 authored by F4BWG's avatar F4BWG

Update 1.3.2

parent 76e4b994
==== Version 1.3.2
+ Added displaying Tarantool version in the title bar
+ Updated README
==== Version: 1.3.0b
+ cosmetic revision
......@@ -11,7 +15,7 @@ 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 @bm_3101 @bm2082 etc.)
Several master servers have their own twitter account (@bm_3021 @bm2082 etc.)
Requires twidge to be installed and configured in the default folder.
+ Added the ability to search for an event in the latest logs
......
......@@ -9,6 +9,10 @@ This script relies on the following packages:
ncurses
dialog
Optionally, if you install the Twidge twitter client you can twitt directly from the menu. This is ideal to announce updates
made to the server, and restarts. The git repository for Twidge can be found here: https://github.com/jgoerzen/twidge
Installation
========================================
......@@ -17,7 +21,10 @@ Installation
mv bm-menu.sh /opt/BrandMeister
chmod 755 /opt/BrandMeister/bm-menu.sh
* Edit the file with your favorite editor, and update the MYEDITOR and TITLE variables to your liking.
Common settings for MYEDITOR are:
MYEDITOR=/usr/bin/vi
MYEDITOR=/usr/bin/nano
MYEDITOR=/usr/bin/emacs
* Assuming your shell is bash, edit the /etc/bash.bashrc file, and add the following line at the end:
/opt/BrandMeister/bm-menu.sh
......@@ -42,4 +49,4 @@ https://code.brandmeister.network/F4BWG/NCursesMasterMenu
Questions / Comments / Suggestions
========================================
Please send all questions, comments and suggestions to oli at f4bwg.com
Please send all questions, comments and suggestions to the email address: brandmeister at f4bwg.com
#################################################################
# NCurses-Based Bash Menu for BM Master Sysops #
# Version: 1.3.0b #
# Questions/Comments: oli@f4bwg.com #
# Latest Version: #
# https://code.brandmeister.network/F4BWG/NCursesMasterMenu #
# Don't forget to update the MYEDITOR and TITLE variables below #
#################################################################
#####################################################################################
# NCurses-Based Bash Menu for BM Master Sysops
# Version: 1.3.2
#
# Questions/Comments: oli@f4bwg.com
# Latest Version can be downloaded at:
# https://code.brandmeister.network/F4BWG/NCursesMasterMenu
#
# !!! Don't forget to update the MYEDITOR and TITLE variables below !!!
#
# Copyright (c) 2017~2018 The BrandMeister Development Team - All rights reserved
# This file is a part of Project BrandMeister Master Server and is licenced to you
# under the MIT License (MIT); you may not use this file except in compliance with
# the MIT license. You may obtain a copy of the MIT license at
#
# https://opensource.org/licenses/MIT
#
# For more information about BrandMeister, see http://brandmeister.network
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the MIT License is provided "AS IS", without warranty of any kind, express
# or implied, including but not limited to the warranties of merchantability, fitness
# for a particular purpose and non-infringement. In no event shall the authors or
# copyright holders be liable for any claim, damages or other liability, whether in
# an action of contract, tort or otherwise, arising from, out of or in connection
# with the software or the use or other dealings in the software.
#
#####################################################################################
#!/bin/bash
#### YOU CAN CHANGE THESE SETTINGS ####
......@@ -18,95 +38,96 @@ TITLE="BM-3021-CA"
#### YOU SHOULD NOT CHANGE THESE SETTINGS####
VSCRIPT="1.3.0b"
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 }') $(service brandmeister status | grep -i active:)"
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"
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"
)
)
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
tail -f /var/log/syslog ; ~/bm-menu.sh
$THISFILE
;;
tail -f /var/log/syslog ; ~/bm-menu.sh
$THISFILE
;;
2)
read -p "Event to search: " searchit
grep -i brandmeister /var/log/syslog | grep -i $searchit
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
;;
$THISFILE
;;
3)
$MYEDITOR /opt/BrandMeister/BrandMeister.conf
$THISFILE
;;
$MYEDITOR /opt/BrandMeister/BrandMeister.conf
$THISFILE
;;
4)
tarantoolctl connect /tmp/Registry.sock
$THISFILE
;;
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"
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 " ========================================"
apt-get update
echo " ========================================"
echo " ========> Starting upgrade process"
echo " ========================================"
apt-get upgrade
echo " ========================================"
echo " ========> Restarting tarantool"
echo " ========================================"
echo " ========================================"
echo " ========> Updating packages"
echo " ========================================"
apt-get update
echo " ========================================"
echo " ========> Starting upgrade process"
echo " ========================================"
apt-get upgrade
echo " ========================================"
echo " ========> Restarting tarantool"
echo " ========================================"
/usr/bin/tarantoolctl restart Registry
echo " ========================================"
read -n1 -r -p "Upgrade process finished. Press a key." key
$THISFILE
;;
echo " ========================================"
read -n1 -r -p "Upgrade process finished. Press a key." key
$THISFILE
;;
7)
systemctl restart brandmeister ; tail -f /var/log/syslog
$THISFILE
;;
systemctl restart brandmeister ; tail -f /var/log/syslog
$THISFILE
;;
8)
read -p "Text to tweet: " tweetit
/usr/bin/twidge update "$tweetit"
read -p "Text to tweet: " tweetit
/usr/bin/twidge update "$tweetit"
read -p "Done ! Press enter to continue"
$THISFILE
;;
$THISFILE
;;
9)
echo "box.space.StoredBans:select()" | /usr/bin/tarantoolctl connect /tmp/Registry.sock
read -n1 -r -p "End of list..." key
$THISFILE
;;
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
$THISFILE
;;
wget --backups=2 -O $THISFILE https://code.brandmeister.network/F4BWG/NCursesMasterMenu/raw/master/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