update
This commit is contained in:
@@ -273,7 +273,7 @@ DISP_HEADER(){
|
|||||||
if [ "$1" = true ]; then
|
if [ "$1" = true ]; then
|
||||||
clear
|
clear
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[LightGreen]} NodeMgmt - Node Monitoring & Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]} NodeMgmt - Node Monitoring & Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}"
|
||||||
DIVIDER . lightGreen
|
DIVIDER . lightGreen
|
||||||
if [ "$2" = true ]; then
|
if [ "$2" = true ]; then
|
||||||
@@ -311,7 +311,7 @@ DISP_HEADER(){
|
|||||||
DIVIDER
|
DIVIDER
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
CERT-CHECK(){
|
CERT-CHECK(){
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ NEWCERT(){
|
|||||||
fi
|
fi
|
||||||
if [ "${NEW_CERT}" != "" ]; then
|
if [ "${NEW_CERT}" != "" ]; then
|
||||||
echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}Requesting Certificate for '${idsCL[Yellow]}${NEW_CERT}${idsCL[LightGreen]}'...${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
# echo -en "${idsCL[LightYellow]}Stopping other Webservers... ${idsCL[Default]}"
|
# echo -en "${idsCL[LightYellow]}Stopping other Webservers... ${idsCL[Default]}"
|
||||||
# for nip in "${WEB_HOSTS[@]}"; do
|
# for nip in "${WEB_HOSTS[@]}"; do
|
||||||
@@ -89,7 +89,7 @@ NEWCERT(){
|
|||||||
# done
|
# done
|
||||||
# echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
|
# echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
|
||||||
|
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
@@ -106,21 +106,21 @@ DEL-SSL(){
|
|||||||
if [ -z ${1+x} ]; then
|
if [ -z ${1+x} ]; then
|
||||||
echo -e -n "${idsCL[LightCyan]}Delete what SSL site address: ${idsCL[Default]}"
|
echo -e -n "${idsCL[LightCyan]}Delete what SSL site address: ${idsCL[Default]}"
|
||||||
read DEL_SSL
|
read DEL_SSL
|
||||||
echo ""
|
echo
|
||||||
else
|
else
|
||||||
DEL_SSL=${1}
|
DEL_SSL=${1}
|
||||||
fi
|
fi
|
||||||
if [ ! -z ${DEL_SSL+x} ] && [ "${DEL_SSL}" != "" ]; then
|
if [ ! -z ${DEL_SSL+x} ] && [ "${DEL_SSL}" != "" ]; then
|
||||||
if [ -d /etc/letsencrypt/live/${DEL_SSL} ]; then
|
if [ -d /etc/letsencrypt/live/${DEL_SSL} ]; then
|
||||||
echo -e "${idsCL[LightRed]}Deleting the SSL certificates for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}'...${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}Deleting the SSL certificates for '${idsCL[Red]}${DEL_SSL}${idsCL[LightRed]}'...${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
echo -en "${idsCL[LightRed]}Removing Files and Folders... ${idsCL[Default]}"
|
echo -en "${idsCL[LightRed]}Removing Files and Folders... ${idsCL[Default]}"
|
||||||
rm -rf /etc/letsencrypt/archive/${DEL_SSL}
|
rm -rf /etc/letsencrypt/archive/${DEL_SSL}
|
||||||
rm -rf /etc/letsencrypt/live/${DEL_SSL}
|
rm -rf /etc/letsencrypt/live/${DEL_SSL}
|
||||||
rm -f /etc/letsencrypt/renewal/${DEL_SSL}.conf
|
rm -f /etc/letsencrypt/renewal/${DEL_SSL}.conf
|
||||||
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -160,7 +160,7 @@ CERTRENEW(){
|
|||||||
echo
|
echo
|
||||||
SERVICE nginx restart 2>&1 | tee -a ${FOLDER}/cert-renewal.lastrun
|
SERVICE nginx restart 2>&1 | tee -a ${FOLDER}/cert-renewal.lastrun
|
||||||
echo -e "${idsCL[LightGreen]}The certificates have been renewed.${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}The certificates have been renewed.${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
@@ -266,7 +266,7 @@ LISTCERTS(){
|
|||||||
DIVIDER true
|
DIVIDER true
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
LISTCERTS_NPM(){
|
LISTCERTS_NPM(){
|
||||||
@@ -341,7 +341,7 @@ LISTCERTS_NPM(){
|
|||||||
DIVIDER true
|
DIVIDER true
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
COPYCERTS_NPM(){
|
COPYCERTS_NPM(){
|
||||||
ssldir='/opt/nginx-proxy/ssl'
|
ssldir='/opt/nginx-proxy/ssl'
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ DELSITE(){
|
|||||||
-list) DELSITES; exit 0;;
|
-list) DELSITES; exit 0;;
|
||||||
-*)
|
-*)
|
||||||
echo "Invalid option: '${1}' requires an argument" 1>&2
|
echo "Invalid option: '${1}' requires an argument" 1>&2
|
||||||
echo ""
|
echo
|
||||||
echo -e "Usage: ${idsCL[Yellow]}nodemgmt delsite${idsCL[Default]} {"
|
echo -e "Usage: ${idsCL[Yellow]}nodemgmt delsite${idsCL[Default]} {"
|
||||||
width=33
|
width=33
|
||||||
printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)"
|
printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)"
|
||||||
@@ -22,7 +22,7 @@ DELSITE(){
|
|||||||
if [ -z ${DEL_SITE+x} ]; then
|
if [ -z ${DEL_SITE+x} ]; then
|
||||||
echo -e -n "${idsCL[LightCyan]}Delete what site address: ${idsCL[Default]}"
|
echo -e -n "${idsCL[LightCyan]}Delete what site address: ${idsCL[Default]}"
|
||||||
read DEL_SITE
|
read DEL_SITE
|
||||||
echo ""
|
echo
|
||||||
fi
|
fi
|
||||||
if [[ $DEL_SSL =~ ^[Nn]$ ]]; then
|
if [[ $DEL_SSL =~ ^[Nn]$ ]]; then
|
||||||
DEL_SSL=no
|
DEL_SSL=no
|
||||||
@@ -39,7 +39,7 @@ DELSITE(){
|
|||||||
fi
|
fi
|
||||||
if [ ! -z ${DEL_SITE+x} ] && [ "${DEL_SITE}" != "" ]; then
|
if [ ! -z ${DEL_SITE+x} ] && [ "${DEL_SITE}" != "" ]; then
|
||||||
echo -e "${idsCL[LightRed]}Deleting site '${idsCL[Red]}${DEL_SITE^^}${idsCL[LightRed]}'...${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}Deleting site '${idsCL[Red]}${DEL_SITE^^}${idsCL[LightRed]}'...${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
echo -e "${idsCL[LightRed]}[[Removing Files and Folders]]${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}[[Removing Files and Folders]]${idsCL[Default]}"
|
||||||
echo -e "${idsCL[LightRed]}-------------------------------------------${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}-------------------------------------------${idsCL[Default]}"
|
||||||
@@ -90,12 +90,12 @@ DELSITE(){
|
|||||||
# fi
|
# fi
|
||||||
# nid=`expr $nid + 1`
|
# nid=`expr $nid + 1`
|
||||||
# done
|
# done
|
||||||
# echo ""
|
# echo
|
||||||
# SERVICE nginx reload ns
|
# SERVICE nginx reload ns
|
||||||
echo -e "${idsCL[LightRed]}Site has been deleted.${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}Site has been deleted.${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo "Missing arguments"
|
echo "Missing arguments"
|
||||||
echo ""
|
echo
|
||||||
echo -e "Usage: ${idsCL[Yellow]}nodemgmt delsite${idsCL[Default]} {"
|
echo -e "Usage: ${idsCL[Yellow]}nodemgmt delsite${idsCL[Default]} {"
|
||||||
width=33
|
width=33
|
||||||
printf "%-${width}s- %s\n" " -site {FQDN address}" "Site to delete"
|
printf "%-${width}s- %s\n" " -site {FQDN address}" "Site to delete"
|
||||||
@@ -125,15 +125,15 @@ DELSITES(){
|
|||||||
for s in "${!SITES[@]}"; do
|
for s in "${!SITES[@]}"; do
|
||||||
echo " [${s}] ${SITES[${s}]}"
|
echo " [${s}] ${SITES[${s}]}"
|
||||||
done
|
done
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
echo " [B] Back"
|
echo " [B] Back"
|
||||||
fi
|
fi
|
||||||
echo " [Q] Quit"
|
echo " [Q] Quit"
|
||||||
echo ""
|
echo
|
||||||
echo -e -n "${idsCL[LightYellow]}Please select a site from above from above:${idsCL[Default]} "
|
echo -e -n "${idsCL[LightYellow]}Please select a site from above from above:${idsCL[Default]} "
|
||||||
read selsite
|
read selsite
|
||||||
echo ""
|
echo
|
||||||
if [ -z ${SITES[$selsite]} ] && [ "${selsite}" != "Q" ] && [ "${selsite}" != "q" ] && [ "${selsite}" != "B" ] && [ "${selsite}" != "b" ]; then
|
if [ -z ${SITES[$selsite]} ] && [ "${selsite}" != "Q" ] && [ "${selsite}" != "q" ] && [ "${selsite}" != "B" ] && [ "${selsite}" != "b" ]; then
|
||||||
echo "Thats an invaild option,"
|
echo "Thats an invaild option,"
|
||||||
echo "please select a valid option only."
|
echo "please select a valid option only."
|
||||||
@@ -149,12 +149,12 @@ DELSITES(){
|
|||||||
do
|
do
|
||||||
echo -e -n "${idsCL[LightRed]}Are you sure you want to delete '${idsCL[Red]}${SITES[${selsite}]^^}${idsCL[LightRed]}'? [y/N]${idsCL[Default]} "
|
echo -e -n "${idsCL[LightRed]}Are you sure you want to delete '${idsCL[Red]}${SITES[${selsite}]^^}${idsCL[LightRed]}'? [y/N]${idsCL[Default]} "
|
||||||
read response
|
read response
|
||||||
echo ""
|
echo
|
||||||
if [[ $response =~ ^[Yy]$ ]]; then
|
if [[ $response =~ ^[Yy]$ ]]; then
|
||||||
echo -e -n "${idsCL[LightRed]}Do you also want to delete the certs for '${idsCL[Red]}${SITES[${selsite}]^^}${idsCL[LightRed]}', if they exist? [y/N]${idsCL[Default]} "
|
echo -e -n "${idsCL[LightRed]}Do you also want to delete the certs for '${idsCL[Red]}${SITES[${selsite}]^^}${idsCL[LightRed]}', if they exist? [y/N]${idsCL[Default]} "
|
||||||
read sslresponse
|
read sslresponse
|
||||||
DELSITE -site ${SITES[${selsite}]} -ssl ${sslresponse}
|
DELSITE -site ${SITES[${selsite}]} -ssl ${sslresponse}
|
||||||
echo ""
|
echo
|
||||||
DIVIDER
|
DIVIDER
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
break
|
break
|
||||||
@@ -185,7 +185,7 @@ NEWSITE(){
|
|||||||
-exploits) EXPLOITS=${2};;
|
-exploits) EXPLOITS=${2};;
|
||||||
-secure) SECURE=${2};;
|
-secure) SECURE=${2};;
|
||||||
-h | -help | --help)
|
-h | -help | --help)
|
||||||
echo ""
|
echo
|
||||||
echo -e "Usage: ${idsCL[Yellow]}nodemgmt newcert${idsCL[Default]} {"
|
echo -e "Usage: ${idsCL[Yellow]}nodemgmt newcert${idsCL[Default]} {"
|
||||||
width=33
|
width=33
|
||||||
printf "%-${width}s- %s\n" " -site {FQDN address(,es)}" "(new site and aliases, comma separated)"
|
printf "%-${width}s- %s\n" " -site {FQDN address(,es)}" "(new site and aliases, comma separated)"
|
||||||
@@ -329,7 +329,7 @@ NEWSITE(){
|
|||||||
fi
|
fi
|
||||||
if [ "${GO}" = "true" ]; then
|
if [ "${GO}" = "true" ]; then
|
||||||
echo -e "${idsCL[LightGreen]}Setting up new site for '${idsCL[Yellow]}${MAIN_SITE}${idsCL[LightGreen]}' {${NGINX_SERVERNAME}}...${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}Setting up new site for '${idsCL[Yellow]}${MAIN_SITE}${idsCL[LightGreen]}' {${NGINX_SERVERNAME}}...${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
[ "${WEBSOCKET}" == "yes" ] && WEBSOCKET="include conf.d\/include\/websocket-support.conf;" || WEBSOCKET=""
|
[ "${WEBSOCKET}" == "yes" ] && WEBSOCKET="include conf.d\/include\/websocket-support.conf;" || WEBSOCKET=""
|
||||||
[ "${HSTS}" == "yes" ] && HSTS="include conf.d\/include\/hsts-support.conf;" || HSTS=""
|
[ "${HSTS}" == "yes" ] && HSTS="include conf.d\/include\/hsts-support.conf;" || HSTS=""
|
||||||
|
|||||||
@@ -678,7 +678,7 @@ STATUS(){
|
|||||||
########################
|
########################
|
||||||
########################
|
########################
|
||||||
if [ "${ST_ACTION}" != "check" ]; then
|
if [ "${ST_ACTION}" != "check" ]; then
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
|
|||||||
10
install.sh
10
install.sh
@@ -5,7 +5,7 @@ source /dev/stdin <<< "$(curl -sL http://go.scity.us/colorsinc)"
|
|||||||
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
|
source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[LightGreen]}NodeMgmt Installation Script${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}NodeMgmt Installation Script${idsCL[Default]}"
|
||||||
|
|
||||||
do_with_root $APTFUNC -y install wget curl git
|
do_with_root $APTFUNC -y install wget curl git
|
||||||
@@ -33,11 +33,11 @@ echo -e "NODE_HOSTNAME=\"$(hostname)\"
|
|||||||
" > /opt/idssys/nodemgmt/settings.conf
|
" > /opt/idssys/nodemgmt/settings.conf
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[Yellow]}NodeMgmt has been Installed${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}NodeMgmt has been Installed${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
echo -e "To run, use the command: ${idsCL[Green]}nodemgmt${idsCL[Default]}"
|
echo -e "To run, use the command: ${idsCL[Green]}nodemgmt${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
@@ -124,7 +124,7 @@ BACKUP(){
|
|||||||
done
|
done
|
||||||
touch ${FOLDER}/backup.lastrun
|
touch ${FOLDER}/backup.lastrun
|
||||||
# if [ "${action}" != "backup" ]; then
|
# if [ "${action}" != "backup" ]; then
|
||||||
echo ""
|
echo
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
# fi
|
# fi
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
@@ -226,7 +226,7 @@ SET-PERMISSIONS(){
|
|||||||
${NCMD} chown -R root:letsencrypt /etc/letsencrypt
|
${NCMD} chown -R root:letsencrypt /etc/letsencrypt
|
||||||
${NCMD} chmod -R 6775 /etc/letsencrypt
|
${NCMD} chmod -R 6775 /etc/letsencrypt
|
||||||
echo -e "${idsCL[Green]}Complete${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Complete${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
fi
|
fi
|
||||||
nid=`expr $nid + 1`
|
nid=`expr $nid + 1`
|
||||||
done
|
done
|
||||||
@@ -270,12 +270,12 @@ SET-PERMISSIONS(){
|
|||||||
${NCMD} chown -R www-data:www-data /opt/powerdns-admin
|
${NCMD} chown -R www-data:www-data /opt/powerdns-admin
|
||||||
${NCMD} chmod -R 775 /opt/powerdns-admin
|
${NCMD} chmod -R 775 /opt/powerdns-admin
|
||||||
echo -e "${idsCL[Green]}Complete${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Complete${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
nid=`expr $nid + 1`
|
nid=`expr $nid + 1`
|
||||||
done
|
done
|
||||||
if [ "${NEW_SITE}" != "" ]; then echo ""; fi
|
if [ "${NEW_SITE}" != "" ]; then echo ; fi
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
fi
|
fi
|
||||||
@@ -285,7 +285,7 @@ SET-PERMISSIONS(){
|
|||||||
SERVICES(){
|
SERVICES(){
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[Green]}Node Services${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Node Services${idsCL[Default]}"
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
s=1
|
s=1
|
||||||
@@ -294,16 +294,16 @@ SERVICES(){
|
|||||||
echo " [${s}] ${NM_SERVICES[${srvc}]}"
|
echo " [${s}] ${NM_SERVICES[${srvc}]}"
|
||||||
s=`expr $s + 1`
|
s=`expr $s + 1`
|
||||||
done
|
done
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
echo " [B] Back"
|
echo " [B] Back"
|
||||||
fi
|
fi
|
||||||
echo " [Q] Quit"
|
echo " [Q] Quit"
|
||||||
echo ""
|
echo
|
||||||
echo -e -n "${idsCL[LightYellow]}Please select a service from above:${idsCL[Default]} "
|
echo -e -n "${idsCL[LightYellow]}Please select a service from above:${idsCL[Default]} "
|
||||||
read -n 1 selsrvc
|
read -n 1 selsrvc
|
||||||
selsrvc=`expr $selsrvc - 1`
|
selsrvc=`expr $selsrvc - 1`
|
||||||
echo ""
|
echo
|
||||||
if [ -z ${NODE_SERVICES[${selsrvc}]} ] && [ "${selsrvc}" != "Q" ] && [ "${selsrvc}" != "q" ] && [ "${selsrvc}" != "B" ] && [ "${selsrvc}" != "b" ]; then
|
if [ -z ${NODE_SERVICES[${selsrvc}]} ] && [ "${selsrvc}" != "Q" ] && [ "${selsrvc}" != "q" ] && [ "${selsrvc}" != "B" ] && [ "${selsrvc}" != "b" ]; then
|
||||||
echo "Thats an invaild option,"
|
echo "Thats an invaild option,"
|
||||||
echo "please select a valid option only."
|
echo "please select a valid option only."
|
||||||
@@ -315,7 +315,7 @@ SERVICES(){
|
|||||||
elif [ "${selsrvc}" = "B" ] || [ "${selsrvc}" = "b" ]; then
|
elif [ "${selsrvc}" = "B" ] || [ "${selsrvc}" = "b" ]; then
|
||||||
GUI
|
GUI
|
||||||
else
|
else
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[Green]}Node Service Selected: '${idsST[Bold]}${NM_SERVICES[${NODE_SERVICES[${selsrvc}]}]}${idsST[Reset]}${idsCL[Green]}'${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Node Service Selected: '${idsST[Bold]}${NM_SERVICES[${NODE_SERVICES[${selsrvc}]}]}${idsST[Reset]}${idsCL[Green]}'${idsCL[Default]}"
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
s=1
|
s=1
|
||||||
@@ -323,16 +323,16 @@ SERVICES(){
|
|||||||
echo " [${s}] ${srvcopt~}"
|
echo " [${s}] ${srvcopt~}"
|
||||||
s=`expr $s + 1`
|
s=`expr $s + 1`
|
||||||
done
|
done
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
echo " [B] Back"
|
echo " [B] Back"
|
||||||
fi
|
fi
|
||||||
echo " [Q] Quit"
|
echo " [Q] Quit"
|
||||||
echo ""
|
echo
|
||||||
echo -e -n "${idsCL[LightYellow]}Please select an action to run from above:${idsCL[Default]} "
|
echo -e -n "${idsCL[LightYellow]}Please select an action to run from above:${idsCL[Default]} "
|
||||||
read -n 1 selsrvcopt
|
read -n 1 selsrvcopt
|
||||||
selsrvcopt=`expr $selsrvcopt - 1`
|
selsrvcopt=`expr $selsrvcopt - 1`
|
||||||
echo ""
|
echo
|
||||||
if [ -z ${NM_SRVCOPT[${selsrvcopt}]} ] && [ "${selsrvcopt}" != "Q" ] && [ "${selsrvcopt}" != "q" ] && [ "${selsrvcopt}" != "B" ] && [ "${selsrvcopt}" != "b" ]; then
|
if [ -z ${NM_SRVCOPT[${selsrvcopt}]} ] && [ "${selsrvcopt}" != "Q" ] && [ "${selsrvcopt}" != "q" ] && [ "${selsrvcopt}" != "B" ] && [ "${selsrvcopt}" != "b" ]; then
|
||||||
echo "Thats an invaild option,"
|
echo "Thats an invaild option,"
|
||||||
echo "please select a valid option only."
|
echo "please select a valid option only."
|
||||||
@@ -347,7 +347,7 @@ SERVICES(){
|
|||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
SERVICE ${NODE_SERVICES[${selsrvc}]} ${NM_SRVCOPT[${selsrvcopt}]}
|
SERVICE ${NODE_SERVICES[${selsrvc}]} ${NM_SRVCOPT[${selsrvcopt}]}
|
||||||
echo ""
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER
|
DIVIDER
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
@@ -721,9 +721,9 @@ HAPROXY-CONFIG() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
SERVICE haproxy reload
|
SERVICE haproxy reload
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[Green]}HAProxy Config Files have been created.${idsCL[Default]}"
|
echo -e "${idsCL[Green]}HAProxy Config Files have been created.${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
SINGLE_SERVER_SERVICE_CHECK(){
|
SINGLE_SERVER_SERVICE_CHECK(){
|
||||||
@@ -831,9 +831,9 @@ KEEPALIVE-CONFIG() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
SERVICE keepalived reload
|
SERVICE keepalived reload
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[Green]}Keepalive Config Files have been created.${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Keepalive Config Files have been created.${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
NODEUPDATE() {
|
NODEUPDATE() {
|
||||||
@@ -981,9 +981,9 @@ ADD_LOGROTATE_CRONTAB(){
|
|||||||
(crontab -l ; echo "0 */1 * * * logrotate -f ${FOLDER}/tmp-logrotate")| crontab -
|
(crontab -l ; echo "0 */1 * * * logrotate -f ${FOLDER}/tmp-logrotate")| crontab -
|
||||||
fi
|
fi
|
||||||
/bin/chmod 0644 ${FOLDER}/tmp-logrotate
|
/bin/chmod 0644 ${FOLDER}/tmp-logrotate
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[Green]}The crontab entry has been made${idsCL[Default]}"
|
echo -e "${idsCL[Green]}The crontab entry has been made${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
read -n 1 -s -p "Press any key to continue"
|
read -n 1 -s -p "Press any key to continue"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
@@ -1031,9 +1031,9 @@ UPDATE_DYNDNS(){
|
|||||||
else
|
else
|
||||||
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}${1^^} WAN IP has not changed '${OLDIP}' = '${NEWIP}'${idsCL[Default]}"
|
[ "${2}" != 'q' ] && echo -e "${idsCL[Green]}${1^^} WAN IP has not changed '${OLDIP}' = '${NEWIP}'${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
|
echo
|
||||||
|
|
||||||
# if [ "${2}" != 'q' ]; then
|
# if [ "${2}" != 'q' ]; then
|
||||||
# echo ""
|
|
||||||
# read -n 1 -s -p "Press any key to continue"
|
# read -n 1 -s -p "Press any key to continue"
|
||||||
# echo
|
# echo
|
||||||
# fi
|
# fi
|
||||||
@@ -1128,7 +1128,7 @@ DOWNLIST(){
|
|||||||
DIVIDER true
|
DIVIDER true
|
||||||
ENTER2CONTINUE
|
ENTER2CONTINUE
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
UPDATEPUSHOVERINFO(){
|
UPDATEPUSHOVERINFO(){
|
||||||
@@ -1188,26 +1188,26 @@ GUI(){
|
|||||||
do
|
do
|
||||||
echo " [1] Node Status"
|
echo " [1] Node Status"
|
||||||
echo " [2] Node Services"
|
echo " [2] Node Services"
|
||||||
echo ""
|
echo
|
||||||
echo " [3] New Site"
|
echo " [3] New Site"
|
||||||
echo " [4] Delete Site"
|
echo " [4] Delete Site"
|
||||||
echo ""
|
echo
|
||||||
echo " [5] New Certificate"
|
echo " [5] New Certificate"
|
||||||
echo " [6] Renew Certificates"
|
echo " [6] Renew Certificates"
|
||||||
echo " [7] List Certificates"
|
echo " [7] List Certificates"
|
||||||
echo ""
|
echo
|
||||||
echo " [8] Set folder permissions on nodes"
|
echo " [8] Set folder permissions on nodes"
|
||||||
echo " [9] Backup Node Settings and Files"
|
echo " [9] Backup Node Settings and Files"
|
||||||
echo ""
|
echo
|
||||||
echo " [D] Update Primary DNS Records"
|
echo " [D] Update Primary DNS Records"
|
||||||
echo " [R] Add cron task to rotate wtmp & btmp log files"
|
echo " [R] Add cron task to rotate wtmp & btmp log files"
|
||||||
echo ""
|
echo
|
||||||
echo " [Q] Quit"
|
echo " [Q] Quit"
|
||||||
echo ""
|
echo
|
||||||
echo ""
|
echo
|
||||||
echo -e -n "${idsCL[LightYellow]}Please select an [ActionItem] from above:${idsCL[Default]} "
|
echo -e -n "${idsCL[LightYellow]}Please select an [ActionItem] from above:${idsCL[Default]} "
|
||||||
read -n 1 opt
|
read -n 1 opt
|
||||||
echo ""
|
echo
|
||||||
case $opt in
|
case $opt in
|
||||||
1) STATUS; GUI;;
|
1) STATUS; GUI;;
|
||||||
2) SERVICES; GUI;;
|
2) SERVICES; GUI;;
|
||||||
@@ -1367,8 +1367,8 @@ GUI(){
|
|||||||
echo -e " ${idsCL[Yellow]}update-dyndns${idsCL[Default]} - Update DYNDNS records"
|
echo -e " ${idsCL[Yellow]}update-dyndns${idsCL[Default]} - Update DYNDNS records"
|
||||||
echo -e " ${idsCL[Yellow]}vc-ssl${idsCL[Default]} - Update vCenter SSL"
|
echo -e " ${idsCL[Yellow]}vc-ssl${idsCL[Default]} - Update vCenter SSL"
|
||||||
echo -e "}"
|
echo -e "}"
|
||||||
echo ""
|
echo
|
||||||
echo ""
|
echo
|
||||||
exit 0;;
|
exit 0;;
|
||||||
esac
|
esac
|
||||||
# else
|
# else
|
||||||
|
|||||||
2
run.sh
2
run.sh
@@ -19,7 +19,7 @@ if [[ "${noheader}" != *" ${1} "* ]] && [[ "${noheader}" != *" ${2} "* ]] && [ "
|
|||||||
if curl -m 5 -s --head --request GET https://git.schroedercity.com | grep "HTTP/2 200" > /dev/null; then
|
if curl -m 5 -s --head --request GET https://git.schroedercity.com | grep "HTTP/2 200" > /dev/null; then
|
||||||
if [ "${2}" != "q" ]; then
|
if [ "${2}" != "q" ]; then
|
||||||
echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}"
|
echo -en "${idsCL[LightCyan]}Checking for updates...${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
fi
|
fi
|
||||||
cd /opt/idssys/defaults
|
cd /opt/idssys/defaults
|
||||||
if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then
|
if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ usage()
|
|||||||
{
|
{
|
||||||
echo "Usage: $0 [ -e email address ] [-E sender email address] [ -x days ] [-q] [-a] [-b] [-h] [-i] [-n] [-N] [-v]"
|
echo "Usage: $0 [ -e email address ] [-E sender email address] [ -x days ] [-q] [-a] [-b] [-h] [-i] [-n] [-N] [-v]"
|
||||||
echo " { [ -s common_name ] && [ -p port] } || { [ -f cert_file ] } || { [ -c cert file ] } || { [ -d cert dir ] }"
|
echo " { [ -s common_name ] && [ -p port] } || { [ -f cert_file ] } || { [ -c cert file ] } || { [ -d cert dir ] }"
|
||||||
echo ""
|
echo
|
||||||
echo " -a : Send a warning message through E-mail"
|
echo " -a : Send a warning message through E-mail"
|
||||||
echo " -b : Will not print header"
|
echo " -b : Will not print header"
|
||||||
echo " -c cert file : Print the expiration date for the PEM or PKCS12 formatted certificate in cert file"
|
echo " -c cert file : Print the expiration date for the PEM or PKCS12 formatted certificate in cert file"
|
||||||
@@ -593,7 +593,7 @@ usage()
|
|||||||
echo " -v : Specify a specific protocol version to use (tls, ssl2, ssl3)"
|
echo " -v : Specify a specific protocol version to use (tls, ssl2, ssl3)"
|
||||||
echo " -V : Only print validation data"
|
echo " -V : Only print validation data"
|
||||||
echo " -x days : Certificate expiration interval (eg. if cert_date < days)"
|
echo " -x days : Certificate expiration interval (eg. if cert_date < days)"
|
||||||
echo ""
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ check_server_status() {
|
|||||||
TLSFLAG="${TLSFLAG} -servername $1"
|
TLSFLAG="${TLSFLAG} -servername $1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "" | ${OPENSSL} s_client -crlf ${VER} -connect ${1}:${2} ${TLSFLAG} 2> ${ERROR_TMP} 1> ${CERT_TMP}
|
echo | ${OPENSSL} s_client -crlf ${VER} -connect ${1}:${2} ${TLSFLAG} 2> ${ERROR_TMP} 1> ${CERT_TMP}
|
||||||
|
|
||||||
if ${GREP} -i "Connection refused" ${ERROR_TMP} > /dev/null
|
if ${GREP} -i "Connection refused" ${ERROR_TMP} > /dev/null
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ source /dev/stdin <<< "$(curl -sL http://go.scity.us/defaultinc)"
|
|||||||
if [ "$EUID" -ne 0 ]; then APTFUNC="sudo ${ATYPE}"
|
if [ "$EUID" -ne 0 ]; then APTFUNC="sudo ${ATYPE}"
|
||||||
else APTFUNC="${ATYPE}"
|
else APTFUNC="${ATYPE}"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[LightGreen]}NodeMgmt Removal Script${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}NodeMgmt Removal Script${idsCL[Default]}"
|
||||||
|
|
||||||
|
|
||||||
@@ -21,8 +21,8 @@ if [ "$IDSSYSF" = 2 ]; then
|
|||||||
rm -Rf /opt/idssys/defaults
|
rm -Rf /opt/idssys/defaults
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo
|
||||||
echo -e "${idsCL[LightRed]}NodeMgmt has been Removed${idsCL[Default]}"
|
echo -e "${idsCL[LightRed]}NodeMgmt has been Removed${idsCL[Default]}"
|
||||||
echo ""
|
echo
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Reference in New Issue
Block a user