diff --git a/seqs/snmp.sh b/seqs/snmp.sh index 3674623..1266067 100755 --- a/seqs/snmp.sh +++ b/seqs/snmp.sh @@ -18,7 +18,10 @@ step_1() { endReturn -o $? "$toolName installation failed" } -step_2_info() { echo "Setup snmp v3 access"; } +step_2_info() { + echo "Setup snmp v3 access [-s]" + echoinfo " -s : Stop after creating authentication entry" +} step_2() { # ## Create authentication entry @@ -43,6 +46,13 @@ step_2() { read -p "SNMPv3 Username: " v3User read -s -p "SNMPv3 Password: " v3Pass echo + read -s -p "Repeat Password: " v3Pass2 + + if [ "$v3Pass" != "$v3Pass2" ] ; then + echoerr " [E] Password mismatch" + return 1 + fi + echo exe service snmpd stop @@ -51,6 +61,13 @@ step_2() { v3AuthEntry="createUser ${v3User} SHA \"${v3Pass}\" DES" addConf -a "$v3AuthEntry" "$v3AuthLoc" + shift + if [ ! -z $1 ] && [ "$1" == "-s" ] ; then + echo " [I] Stop after creating authentication config" + exe service snmpd start + return 0 + fi + # ## Add custom base configuration addConf -c "" "${toolConfig}" @@ -144,6 +161,7 @@ step_25() { ;; esac } +# TODO error when no php is installed phpVersionStr="$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')" phpFpmStatusNginx="# Provide php-fpm status location ~ ^/(status|ping)\$ { @@ -258,5 +276,5 @@ checkExtend() { return 0 } -VERSION_SEQREV=8 -. sequencer.sh +VERSION_SEQREV=10 +. /usr/local/bin/sequencer.sh