1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
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 <csmall@debian.org>
Origin: Debian
Bug-Debian: https://bugs.debian.org/997895
Reviewed-by: Craig Small <csmall@dropbear.xyz>
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"
|