| 5844 | | print "To make the sensors modules behave correctly, add these lines to\n". |
|---|
| 5845 | | "$modules_conf:\n\n"; |
|---|
| 5846 | | print "#----cut here----\n". |
|---|
| 5847 | | $configfile. |
|---|
| 5848 | | "#----cut here----\n\n"; |
|---|
| 5849 | | } |
|---|
| 5850 | | |
|---|
| 5851 | | print "To load everything that is needed, add this to some /etc/rc* file:\n\n"; |
|---|
| 5852 | | print "#----cut here----\n". |
|---|
| 5853 | | $modprobes. |
|---|
| 5854 | | "# sleep 2 # optional\n". |
|---|
| 5855 | | (-e '/usr/bin/sensors' ? |
|---|
| 5856 | | "/usr/bin/sensors -s # recommended\n" : |
|---|
| 5857 | | "/usr/local/bin/sensors -s # recommended\n") . |
|---|
| 5858 | | "#----cut here----\n\n"; |
|---|
| 5859 | | |
|---|
| 5860 | | print "If you have some drivers built into your kernel, the list above will\n". |
|---|
| 5861 | | "contain too many modules. Skip the appropriate ones! You really\n". |
|---|
| 5862 | | "should try these commands right now to make sure everything is\n". |
|---|
| 5863 | | "working properly. Monitoring programs won't work until the needed\n". |
|---|
| 5864 | | "modules are loaded.\n\n"; |
|---|
| 5865 | | |
|---|
| | 5840 | my $have_modprobe_d = -d '/etc/modprobe.d'; |
|---|
| | 5841 | printf "Do you want to \%s /etc/modprobe.d/lm_sensors? (\%s): ", |
|---|
| | 5842 | (-e '/etc/modprobe.d/lm_sensors' ? 'overwrite' : 'generate'), |
|---|
| | 5843 | ($have_modprobe_d ? 'YES/no' : 'yes/NO'); |
|---|
| | 5844 | $_ = <STDIN>; |
|---|
| | 5845 | if (($have_modprobe_d and not m/^\s*n/i) or m/^\s*y/i) { |
|---|
| | 5846 | unless ($have_modprobe_d) { |
|---|
| | 5847 | mkdir '/etc/modprobe.d', 0777 |
|---|
| | 5848 | or die "Sorry, can't create /etc/modprobe.d ($!)"; |
|---|
| | 5849 | } |
|---|
| | 5850 | open(local *MODPROBE_D, ">/etc/modprobe.d/lm_sensors") |
|---|
| | 5851 | or die "Sorry, can't create /etc/modprobe.d/lm_sensors ($!)"; |
|---|
| | 5852 | print MODPROBE_D |
|---|
| | 5853 | "# Generated by sensors-detect on " . scalar localtime() . "\n"; |
|---|
| | 5854 | print MODPROBE_D $configfile; |
|---|
| | 5855 | close(MODPROBE_D); |
|---|
| | 5856 | } else { |
|---|
| | 5857 | print "To make the sensors modules behave correctly, add these lines to\n". |
|---|
| | 5858 | "$modules_conf:\n\n"; |
|---|
| | 5859 | print "#----cut here----\n". |
|---|
| | 5860 | $configfile. |
|---|
| | 5861 | "#----cut here----\n\n"; |
|---|
| | 5862 | } |
|---|
| | 5863 | } |
|---|
| | 5864 | |
|---|
| | 5926 | |
|---|
| | 5927 | print "You should now start the lm_sensors service to load the required\n". |
|---|
| | 5928 | "kernel modules.\n\n"; |
|---|
| | 5929 | } else { |
|---|
| | 5930 | print "To load everything that is needed, add this to e.g. /etc/rc.d/rc.local:\n\n"; |
|---|
| | 5931 | print "#----cut here----\n". |
|---|
| | 5932 | $modprobes. |
|---|
| | 5933 | "# sleep 2 # optional\n". |
|---|
| | 5934 | (-e '/usr/bin/sensors' ? |
|---|
| | 5935 | "/usr/bin/sensors -s # recommended\n" : |
|---|
| | 5936 | "/usr/local/bin/sensors -s # recommended\n") . |
|---|
| | 5937 | "#----cut here----\n\n"; |
|---|
| | 5938 | |
|---|
| | 5939 | print "If you have some drivers built into your kernel, the list above will\n". |
|---|
| | 5940 | "contain too many modules. Skip the appropriate ones! You really\n". |
|---|
| | 5941 | "should try these commands right now to make sure everything is\n". |
|---|
| | 5942 | "working properly. Monitoring programs won't work until the needed\n". |
|---|
| | 5943 | "modules are loaded.\n\n"; |
|---|