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

@@ -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;;