This commit is contained in:
2023-11-15 14:44:07 -06:00
parent 2ab3901144
commit 513a61bf5a
3 changed files with 12 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
VERS='4.14.13-11152023'
VERS='4.14.14-11152023'
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update '
CERT_DAEMON='/snap/bin/certbot'

View File

@@ -475,11 +475,11 @@ LISTCERTS_NPM(){
if [ ! -z ${LOCAL_SERVICES+x} ]; then
NCMD="ssh root@${MYSQL_HOSTS[0]}"
${NCMD} rm -f /tmp/ssllist
${NCMD} 'for certdir in /opt/nginx-proxy/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/ssllist
${NCMD} 'for certdir in ${NM_CERTPATH}/live/*/ ; do echo $certdir; done' > /tmp/ssllist
else
NCMD=''
rm -f /tmp/ssllist
for certdir in /opt/nginx-proxy/letsencrypt/live/*/ ; do echo $certdir; done > /tmp/ssllist
for certdir in ${NM_CERTPATH}/live/*/ ; do echo $certdir; done > /tmp/ssllist
fi
if [ -z $action ] || [ "${action}" = "gui" ]; then
DIVIDER true
@@ -536,7 +536,7 @@ LISTCERTS_NPM(){
echo
}
COPYCERTS_NPM(){
ssldir='/opt/nginx-proxy/ssl'
ssldir='${NM_CERTPATH}/ssl'
if [ "${1}" = "reset" ]; then
echo "Resetting ... Deleting all SSL symlink folders"
@@ -556,7 +556,7 @@ COPYCERTS_NPM(){
DIVIDER true
fi
ssls=$(find /opt/nginx-proxy/letsencrypt/live/* -type d)
ssls=$(find ${NM_CERTPATH}/live/* -type d)
for certdir in ${ssls[@]}; do
SUBJECT=$(openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
if [ ! -L ${ssldir}/${SUBJECT} ]; then
@@ -574,7 +574,7 @@ COPYCERTS_NPM(){
}
CHECK_NPMCERTS(){
ssls=$(find /opt/nginx-proxy/letsencrypt/live/* -type d)
ssls=$(find ${NM_CERTPATH}/live/* -type d)
for certdir in ${ssls[@]}; do
SUBJECT=$(openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)

View File

@@ -67,8 +67,8 @@ SET-PERMISSIONS(){
fi
checkhost=$(CHECK_HOST ${nip})
if [ "${checkhost}" != "false" ]; then
${NCMD} chown -R git:git /var/lib/gitea
${NCMD} chmod -R 750 /var/lib/gitea
${NCMD} chown -R git:git ${NM_REPL_CHECK_LOC['gitea']}
${NCMD} chmod -R 750 ${NM_REPL_CHECK_LOC['gitea']}
${NCMD} chown -R git:git /home/git
${NCMD} chmod -R 750 /home/git
if [ "${2}" != "q" ]; then
@@ -92,8 +92,8 @@ SET-PERMISSIONS(){
fi
checkhost=$(CHECK_HOST ${nip})
if [ "${checkhost}" != "false" ]; then
${NCMD} chown -R www-data:www-data /opt/powerdns-admin
${NCMD} chmod -R 775 /opt/powerdns-admin
${NCMD} chown -R www-data:www-data ${NM_REPL_CHECK_LOC['pdnsadmin']}
${NCMD} chmod -R 775 ${NM_REPL_CHECK_LOC['pdnsadmin']}
if [ "${2}" != "q" ]; then
echo -e "${idsCL[Green]}Complete${idsCL[Default]}"
fi
@@ -177,8 +177,8 @@ SET-PERMISSIONS(){
${NCMD} chmod -R 7777 /var/lib/php/sessions
echo -e "${idsCL[Green]}Complete${idsCL[Default]}"
echo -en "${idsCL[Cyan]}Gitea Folder ${idsCL[Default]}"
${NCMD} chown -R git:git /var/lib/gitea
${NCMD} chmod -R 750 /var/lib/gitea
${NCMD} chown -R git:git ${NM_REPL_CHECK_LOC['gitea']}
${NCMD} chmod -R 750 ${NM_REPL_CHECK_LOC['gitea']}
${NCMD} chown -R git:git /home/git
${NCMD} chmod -R 750 /home/git
echo -e "${idsCL[Green]}Complete${idsCL[Def ault]}"
@@ -398,7 +398,6 @@ NODEUPDATE() {
VCENTER-SSL(){
VCHOSTNAME='vcenter.scity.us'
BASECERTDIR="${NM_CERTPATH}/live"
# BASECERTDIR="/opt/nginx-proxy/ssl"
CERTDIR="${BASECERTDIR}/${VCHOSTNAME}"
SERVER="https://${VCHOSTNAME}"
CRED="administrator@scity.vs:$(pass iDSVC)"
@@ -799,56 +798,6 @@ DOWNLIST(){
echo
}
UPDATEPUSHOVERINFO(){
echo
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
echo -en "${idsCL[LightCyan]}Use current Pushover Info:\nApp Token: [${idsCL[White]}${PUSHOVER_APP_TOKEN}${idsCL[LightCyan]}\nUser Token: [${idsCL[White]}${PUSHOVER_USER_TOKEN}${idsCL[LightCyan]}] (Y/n)? ${idsCL[Default]}"
read -n 1 choice
case "$choice" in
[Nn]) PUSHOVER_APP_TOKEN="";PUSHOVER_USER_TOKEN="";;esac
fi
if [ "${PUSHOVER_APP_TOKEN}" == "" ]; then
echo; echo -e -n "${idsCL[LightCyan]}Pushover App Token: ${idsCL[Default]}"
read -e PUSHOVER_APP_TOKEN
echo; echo -e -n "${idsCL[LightCyan]}(optional) Pushover User Token: ${idsCL[Default]}"
read -e PUSHOVER_USER_TOKEN
fi
declare -A host_ip
declare -A host_name
while read hostid hostname hostip hostlimits; do
if [ "$hostid" != "id" ]; then
host_ip[${hostid}]=$(echo $hostip | cut -d ";" -f1)
host_name[${hostid}]=$hostname
fi
done <<< $(MYSQL_PWD="sysmoninsert" mysql -h mysqldb.scity.us -P 3306 -u sysmoninsert -e "SELECT id,host,ip,limits FROM servermonitor.hosts WHERE disabled=0")
for hostid in "${!host_ip[@]}"; do
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then
echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Running commands${idsCL[Default]}${idsST[Reset]}"
ssh root@${host_ip[$hostid]} "/bin/sed -i '/PUSHOVER_/d' /opt/idssys/nodemgmt/conf/settings.conf"
if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then
echo "putting in info 'root@${host_ip[$hostid]}'"
ssh root@${host_ip[$hostid]} "echo PUSHOVER_APP_TOKEN=\\\"${PUSHOVER_APP_TOKEN}\\\" >> ${MMFOLDER}/conf/settings.conf;"
else
echo "taking out info"
ssh root@${host_ip[$hostid]} "echo \# PUSHOVER_APP_TOKEN=\\\"\\\" >> ${MMFOLDER}/conf/settings.conf"
fi
if [ "${PUSHOVER_USER_TOKEN}" != "" ]; then
ssh root@${host_ip[$hostid]} "echo PUSHOVER_USER_TOKEN=\\\"${PUSHOVER_USER_TOKEN}\\\" >> ${MMFOLDER}/conf/settings.conf;"
else
ssh root@${host_ip[$hostid]} "echo \# PUSHOVER_USER_TOKEN=\\\"\\\" >> ${MMFOLDER}/conf/settings.conf"
fi
else
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
fi
done
}
GUI(){
DISP_HEADER true false
@@ -1035,7 +984,6 @@ GUI(){
keepalive-config) KEEPALIVE-CONFIG;;
vc-ssl) VCENTER-SSL ${2};;
run) RUN_COMMAND ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15};;
update-pushover) UPDATEPUSHOVERINFO;;
backup-offsitepfsense) BACKUP_OFFSITEPFSENSE;;
gui) GUI;;