Repeat password entry and add option to stop after authentication entry creation

todo: fix loose dependency to php which leads to error on every run
This commit is contained in:
2020-02-14 22:03:41 +01:00
parent 809d40e8a2
commit 8e3b0355ff

View File

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