aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/net-snmp-devel/files/patch-local:snmpconf
blob: 584e473e27d23f281e2ee4168f6d3ea1db5b0539 (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- local/snmpconf.orig	Tue Apr 20 23:20:51 2004
+++ local/snmpconf	Thu Jun 24 23:12:06 2004
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!%%PERL%% -w
 
 #
 # A simple configuration file builder based on questions listed in
@@ -21,7 +21,7 @@
   $opts{'c'} = "$ENV{SNMPSHAREPATH}/snmpconf-data";
 }
 else {
-  $opts{'c'} = "/usr/local/share/snmp/snmpconf-data";
+  $opts{'c'} = "%%PREFIX%%/share/snmp/snmpconf-data";
 }
 
 # default config file path
@@ -29,7 +29,7 @@
   $confpath = "$ENV{SNMPCONFPATH}";
 }
 else {
-  $confpath = "/usr/local/share/snmp";
+  $confpath = "%%PREFIX%%/share/snmp";
 }
 
 # home environment variable
@@ -84,7 +84,7 @@
 #
 # Find existing files to possibly read in.
 #
-my @searchpath = ("$confpath","/usr/local/etc/snmp", ".", "$home");
+my @searchpath = ("$confpath","%%PREFIX%%/etc/snmp", ".", "$home");
 push @searchpath, $opts{I} if ($opts{I});
 foreach my $i (@searchpath) {
     debug("searching $i\n");
@@ -183,7 +183,7 @@
 	if ($opts{'i'} || $opts{'I'}) {
           $opts{'I'} = "$confpath" if (!$opts{'I'});
 
-          if (! (-d "$opts{'I'}") && ! (mkdir ("$opts{'I'}"))) {
+          if (! (-d "$opts{'I'}") && ! (mkdir ("$opts{'I'}", 0777))) {
 	    print "\nCould not create $opts{'I'} directory: $!\n";
 	    print ("File $didfile{$i} left in current directory\n");
 	  }
@@ -198,7 +198,7 @@
             }
           }
 	} elsif ($opts{'p'}) {
-	  if (! (-d "$home") && ! (mkdir ("$home"))) {
+	  if (! (-d "$home") && ! (mkdir ("$home", 0777))) {
 	    print "\nCould not create $home directory: $!\n";
 	    print ("File $didfile{$i} left in current directory\n");
 	  }