From 546fe2587fa07697747da4e4c324c3f6c8be7a68 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Fri, 20 May 2022 19:54:27 -0500 Subject: [PATCH] Update SwITNet copyright. Standarize debug option for scripts. --- README.md | 2 +- add-jibri-node.sh | 26 +++++++++++++------------- add-jvb2-node.sh | 29 +++++++++++++++-------------- etherpad-docker.sh | 10 +++++----- grafana.sh | 12 ++++++------ jitsi-updater.sh | 16 +++++++++++++++- jm-bm.sh | 16 +++++++++++++++- jra_nextcloud.sh | 13 +++++++------ mode/chp-mode.sh | 16 ++++++++-------- mode/grid/selenium-grid-docker.sh | 16 +++++++++++++++- mode/jms-stu.sh | 30 +++++++++++++++--------------- mode/jwt.sh | 17 ++++++++++++++++- quick_jibri_installer.sh | 12 ++++++------ tools/aws-grub-setup.sh | 14 ++++++++++++++ tools/fail2ban_ssh.sh | 4 ++-- tools/jibri-conf-upgrade.sh | 4 ++-- tools/jibri-resolution-enhancer.sh | 14 +++++++------- tools/start-over.sh | 14 +++++++------- tools/test-jibri-env.sh | 4 ++-- 19 files changed, 171 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 5a041c3..41af906 100644 --- a/README.md +++ b/README.md @@ -119,4 +119,4 @@ Feel free to use our `test-jibri-env.sh` tool to find some details on your curre Please note: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. -SwITNet Ltd © - 2021, https://switnet.net/ +SwITNet Ltd © - 2022, https://switnet.net/ diff --git a/add-jibri-node.sh b/add-jibri-node.sh index 6738bbd..6ae2fc5 100644 --- a/add-jibri-node.sh +++ b/add-jibri-node.sh @@ -1,26 +1,19 @@ #!/bin/bash # Jibri Node Aggregator -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. ### 0_LAST EDITION TIME STAMP ### # LETS: AUTOMATED_EDITION_TIME ### 1_LAST EDITION ### -#Make sure the file name is the required one -if [ ! "$(basename "$0")" = "add-jibri-node.sh" ]; then - echo "For most cases naming won't matter, for this one it does." - echo "Please use the original name for this script: \`add-jibri-node.sh', and run again." - exit -fi - while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./add_jibri_node.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG @@ -28,6 +21,13 @@ if [ "$MODE" = "debug" ]; then set -x fi +#Make sure the file name is the required one +if [ ! "$(basename "$0")" = "add-jibri-node.sh" ]; then + echo "For most cases naming won't matter, for this one it does." + echo "Please use the original name for this script: \`add-jibri-node.sh', and run again." + exit +fi + #Check admin rights if ! [ "$(id -u)" = 0 ]; then echo "You need to be root or have sudo privileges!" diff --git a/add-jvb2-node.sh b/add-jvb2-node.sh index d85a120..d94ab67 100644 --- a/add-jvb2-node.sh +++ b/add-jvb2-node.sh @@ -1,12 +1,26 @@ #!/bin/bash # JVB2 Node Aggregator -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. ### 0_LAST EDITION TIME STAMP ### # LETS: AUTOMATED_EDITION_TIME ### 1_LAST EDITION ### +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + #Make sure the file name is the required one if [ ! "$(basename "$0")" = "add-jvb2-node.sh" ]; then echo "For most cases naming won't matter, for this one it does." @@ -14,19 +28,6 @@ if [ ! "$(basename "$0")" = "add-jvb2-node.sh" ]; then exit fi -while getopts m: option -do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./add-jvb2-node.sh [-m debug]" && exit;; - esac -done - -#DEBUG -if [ "$MODE" = "debug" ]; then -set -x -fi #Check admin rights if ! [ "$(id -u)" = 0 ]; then diff --git a/etherpad-docker.sh b/etherpad-docker.sh index cde6471..e78be9c 100644 --- a/etherpad-docker.sh +++ b/etherpad-docker.sh @@ -6,11 +6,11 @@ while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./etherpad-docker.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG diff --git a/grafana.sh b/grafana.sh index 173146f..029a9a8 100644 --- a/grafana.sh +++ b/grafana.sh @@ -8,17 +8,17 @@ # by "mephisto" # # Igor Kerstges © - 2021 -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # # GPLv3 or later. while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./grafana.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG diff --git a/jitsi-updater.sh b/jitsi-updater.sh index 00747ae..faefc4a 100644 --- a/jitsi-updater.sh +++ b/jitsi-updater.sh @@ -1,9 +1,23 @@ #!/bin/bash # Jitsi Meet recurring upgrader and customization keeper # for Debian/*buntu binaries. -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GNU GPLv3 or later. +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + Blue='\e[0;34m' Purple='\e[0;35m' Green='\e[0;32m' diff --git a/jm-bm.sh b/jm-bm.sh index 156259a..d5bc4dc 100644 --- a/jm-bm.sh +++ b/jm-bm.sh @@ -1,9 +1,23 @@ #!/bin/bash # Jitsi Meet brandless mode # for Debian/*buntu binaries. -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GNU GPLv3 or later. +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" CSS_FILE="/usr/share/jitsi-meet/css/all.css" TITLE_FILE="/usr/share/jitsi-meet/title.html" diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index 9b548c0..e21e8a8 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -1,14 +1,15 @@ #!/bin/bash # JRA (Jibri Recordings Access) via Nextcloud -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. + while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./jra_nextcloud.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG diff --git a/mode/chp-mode.sh b/mode/chp-mode.sh index dc6e85c..8c7f829 100644 --- a/mode/chp-mode.sh +++ b/mode/chp-mode.sh @@ -1,20 +1,14 @@ #!/bin/bash # Custom High Performance Jitsi conf -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. -#Check if user is root -if ! [ "$(id -u)" = 0 ]; then - echo "You need to be root or have privileges!" - exit 0 -fi - while getopts m: option do case "${option}" in m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./chp-mode.sh [-m debug]" && exit;; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; esac done @@ -23,6 +17,12 @@ if [ "$MODE" = "debug" ]; then set -x fi +#Check if user is root +if ! [ "$(id -u)" = 0 ]; then + echo "You need to be root or have privileges!" + exit 0 +fi + wait_seconds() { secs=$(($1)) while [ $secs -gt 0 ]; do diff --git a/mode/grid/selenium-grid-docker.sh b/mode/grid/selenium-grid-docker.sh index 70fe75f..868efd4 100644 --- a/mode/grid/selenium-grid-docker.sh +++ b/mode/grid/selenium-grid-docker.sh @@ -1,9 +1,23 @@ #!/bin/bash # Custom Selenium Grid-Node fro Jitsi Meet # Pandian © - https://community.jitsi.org/u/Pandian -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + #Check if user is root if ! [ "$(id -u)" = 0 ]; then echo "You need to be root or have sudo privileges!" diff --git a/mode/jms-stu.sh b/mode/jms-stu.sh index eface47..2eb4e2d 100644 --- a/mode/jms-stu.sh +++ b/mode/jms-stu.sh @@ -2,24 +2,29 @@ # System-tune-up to remove system software restrictions on a huge load of connections. # Be aware that hardware/infrastructure resources are the most common limiters. # -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + #Check if user is root if ! [ "$(id -u)" = 0 ]; then echo "You need to be root or have privileges!" exit 0 fi -while getopts m: option -do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./jms-stu.sh [-m debug]" && exit;; - esac -done - echo ' #-------------------------------------------------- # Starting system tune up configuration @@ -27,11 +32,6 @@ echo ' #-------------------------------------------------- ' -#DEBUG -if [ "$MODE" = "debug" ]; then -set -x -fi - set_once_hash_comment() { if ! awk '!/^ *#/ && NF {print}' "$2"|grep -q "$(awk -F '=' '{print$1}' <<< "$1")" ; then echo "Setting $1 on $2..." diff --git a/mode/jwt.sh b/mode/jwt.sh index 92c6bbb..73dc381 100644 --- a/mode/jwt.sh +++ b/mode/jwt.sh @@ -1,7 +1,22 @@ #!/bin/bash # JWT Mode Setup -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. + +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)" MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js" JICOFO_SIP="/etc/jitsi/jicofo/sip-communicator.properties" diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index 9e3f66c..0aff27c 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -1,17 +1,17 @@ #!/bin/bash # Quick Jibri Installer - *buntu (LTS) based systems. -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. { echo "Started at $(date +'%Y-%m-%d %H:%M:%S')" >> qj-installer.log while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./quick_jibri_installer.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG diff --git a/tools/aws-grub-setup.sh b/tools/aws-grub-setup.sh index 20eda57..f485fdb 100644 --- a/tools/aws-grub-setup.sh +++ b/tools/aws-grub-setup.sh @@ -3,6 +3,20 @@ # SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. +while getopts m: option +do + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac +done + +#DEBUG +if [ "$MODE" = "debug" ]; then +set -x +fi + wait_seconds() { secs=$(($1)) while [ $secs -gt 0 ]; do diff --git a/tools/fail2ban_ssh.sh b/tools/fail2ban_ssh.sh index 35d2186..6e03f03 100644 --- a/tools/fail2ban_ssh.sh +++ b/tools/fail2ban_ssh.sh @@ -1,6 +1,6 @@ #!/bin/bash # Simple Fail2ban configuration -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GNU GPLv3 or later. while getopts m: option @@ -8,7 +8,7 @@ do case "${option}" in m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./fail2ban_ssh.sh [-m debug]" && exit;; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; esac done diff --git a/tools/jibri-conf-upgrade.sh b/tools/jibri-conf-upgrade.sh index 654fa63..efebb74 100644 --- a/tools/jibri-conf-upgrade.sh +++ b/tools/jibri-conf-upgrade.sh @@ -1,6 +1,6 @@ #!/bin/bash # Simple Jibri conf updater -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GNU GPLv3 or later. while getopts m: option @@ -8,7 +8,7 @@ do case "${option}" in m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./test-jibri-env.sh [-m debug]" && exit;; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; esac done diff --git a/tools/jibri-resolution-enhancer.sh b/tools/jibri-resolution-enhancer.sh index 24eb78c..4503ecb 100644 --- a/tools/jibri-resolution-enhancer.sh +++ b/tools/jibri-resolution-enhancer.sh @@ -1,20 +1,20 @@ #!/bin/bash # Simple Jibri resolution enhancer -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GNU GPLv3 or later. while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./jibri-resolution-enhancer.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG if [ "$MODE" = "debug" ]; then - set -x +set -x fi #Check if user is root diff --git a/tools/start-over.sh b/tools/start-over.sh index 9c3f871..256bb54 100644 --- a/tools/start-over.sh +++ b/tools/start-over.sh @@ -1,20 +1,20 @@ #!/bin/bash #Start over -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GPLv3 or later. while getopts m: option do - case "${option}" - in - m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./start-over.sh [-m debug]" && exit;; - esac + case "${option}" + in + m) MODE=${OPTARG};; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; + esac done #DEBUG if [ "$MODE" = "debug" ]; then - set -x +set -x fi #Check if user is root diff --git a/tools/test-jibri-env.sh b/tools/test-jibri-env.sh index 39e1a0a..9feffee 100644 --- a/tools/test-jibri-env.sh +++ b/tools/test-jibri-env.sh @@ -1,6 +1,6 @@ #!/bin/bash # Simple Jibri Env tester -# SwITNet Ltd © - 2021, https://switnet.net/ +# SwITNet Ltd © - 2022, https://switnet.net/ # GNU GPLv3 or later. while getopts m: option @@ -8,7 +8,7 @@ do case "${option}" in m) MODE=${OPTARG};; - \?) echo "Usage: sudo ./test-jibri-env.sh [-m debug]" && exit;; + \?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;; esac done