summaryrefslogtreecommitdiffstats
path: root/main/lm_sensors/lm_sensors-3.1.0-sensors-detect-alpine.patch
blob: 9271c6bac2a9fe9eb15fcf532597cbe4a660dbd3 (plain)
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
diff -ru lm_sensors-3.1.0.orig/prog/detect/sensors-detect lm_sensors-3.1.0/prog/detect/sensors-detect
--- lm_sensors-3.1.0.orig/prog/detect/sensors-detect	2009-04-14 07:14:22.000000000 +0000
+++ lm_sensors-3.1.0/prog/detect/sensors-detect	2009-04-14 07:44:48.000000000 +0000
@@ -5282,19 +5282,24 @@
 		}
 	}
 
-	my $have_sysconfig = -d '/etc/sysconfig';
-	printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
-	       (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
-	       ($have_sysconfig ? 'YES/no' : 'yes/NO');
+	my $config = '/etc/conf.d/lm_sensors';
+	my $have_config = -f $config;
+	printf "Do you want to \%s \%s? (\%s): ",
+	       (-e $config ? 'overwrite' : 'generate'),
+	       $config,
+	       ($have_config ? 'YES/no' : 'yes/NO');
 	$_ = <STDIN>;
-	if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
-		unless ($have_sysconfig) {
-			mkdir('/etc/sysconfig', 0777)
-				or die "Sorry, can't create /etc/sysconfig ($!)";
-		}
-		open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
-			or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
+	if (($have_config and not m/^\s*n/i) or m/^\s*y/i) {
+		open(local *SYSCONFIG, ">$config")
+			or die "Sorry, can't create $config ($!)";
 		print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
+		print SYSCONFIG
+			"\n".
+			"# Load modules at startup\n".
+			"LOADMODULES=yes\n\n".
+			"# Initialize sensors at startup\n".
+			"INITSENSORS=yes\n\n";
+
 		print SYSCONFIG <<'EOT';
 # This file is sourced by /etc/init.d/lm_sensors and defines the modules to
 # be loaded/unloaded.