Description: Fix paths for net-snmp-create-v3-user Use the pidof program instead of ps and grep Fix the path for configuration file Author: Craig Small Origin: Debian Bug-Debian: https://bugs.debian.org/997895 Reviewed-by: Craig Small Last-Update: 2023-08-19 --- a/net-snmp-create-v3-user.in +++ b/net-snmp-create-v3-user.in @@ -3,7 +3,7 @@ # this shell script is designed to add new SNMPv3 users # to Net-SNMP config file. -if @PSCMD@ | @EGREP@ ' snmpd *$' > /dev/null 2>&1 ; then +if /bin/pidof -q snmpd > /dev/null 2>&1 ; then echo "Apparently at least one snmpd daemon is already running." echo "You must stop them in order to use this command." exit 1 @@ -138,7 +138,7 @@ datarootdir=@datarootdir@ # To suppress shellcheck complaints about $prefix and $datarootdir. : "$prefix" "$datarootdir" -outfile="@datadir@/snmp/snmpd.conf" +outfile="@SNMPCONFPATH@/snmpd.conf" line="$token $user" echo "adding the following line to $outfile:" echo " $line"