net-snmp/backport-net-snmp-5.9-dir-fix.patch

33 lines
922 B
Diff
Raw Normal View History

2021-12-15 17:17:04 +08:00
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
2023-08-07 01:13:41 +00:00
index 19895a1..ac3c60f 100644
2021-12-15 17:17:04 +08:00
--- a/net-snmp-create-v3-user.in
+++ b/net-snmp-create-v3-user.in
2023-08-07 01:13:41 +00:00
@@ -14,6 +14,10 @@ Xalgorithm="DES"
2021-12-15 17:17:04 +08:00
token=rwuser
2023-08-07 01:13:41 +00:00
2021-12-15 17:17:04 +08:00
while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do
+case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+esac
2023-08-07 01:13:41 +00:00
2021-12-15 17:17:04 +08:00
unset shifted
case $1 in
2023-08-07 01:13:41 +00:00
@@ -134,11 +138,9 @@ if test ! -d "$outfile"; then
touch "$outfile"
fi
2021-12-15 17:17:04 +08:00
echo "$line" >> "$outfile"
2023-08-07 01:13:41 +00:00
-prefix=@prefix@
-datarootdir=@datarootdir@
-# To suppress shellcheck complaints about $prefix and $datarootdir.
-: "$prefix" "$datarootdir"
2021-12-15 17:17:04 +08:00
-outfile="@datadir@/snmp/snmpd.conf"
2023-08-07 01:13:41 +00:00
+# Avoid that configure complains that this script ignores @datarootdir@
+echo "@datarootdir@" >/dev/null
2021-12-15 17:17:04 +08:00
+outfile="/etc/snmp/snmpd.conf"
line="$token $user"
echo "adding the following line to $outfile:"
echo " $line"
2023-08-07 01:13:41 +00:00