File: net-snmp-create-v3-user_paths

package info (click to toggle)
net-snmp 5.9.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 38,720 kB
  • sloc: ansic: 282,878; perl: 17,704; sh: 12,151; makefile: 2,711; python: 734; xml: 663; pascal: 62; sql: 47
file content (28 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download
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"