File: net-snmp-create-v3-user_paths

package info (click to toggle)
net-snmp 5.9.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 37,540 kB
  • sloc: ansic: 282,201; perl: 17,710; sh: 12,006; makefile: 2,712; python: 735; xml: 663; pascal: 62; sql: 47
file content (28 lines) | stat: -rw-r--r-- 1,020 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: 2021-10-27
--- 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 demon 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"