root/lm-sensors/trunk/prog/init/sysconfig-lm_sensors-convert

Revision 5755, 0.8 KB (checked in by khali, 3 years ago)

Fix exit code. If there's no change needed, this is a success, not
a failure.

  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3# Convert an lm_sensors service configuration file from the old convention
4# (MODULE_0, MODULE_1...) to the new convention (HWMON_MODULES).
5#
6# Copyright (C) 2009  Jean Delvare <khali@linux-fr.org>
7#
8# Released without a license on purpose. This is public domain code, so
9# that package maintainers can include it in their post-install script.
10
11CONFIG=/etc/sysconfig/lm_sensors
12test -r "$CONFIG" || exit 0
13
14unset ${!MODULE_*} $HWMON_MODULES
15. "$CONFIG"
16test -n "$HWMON_MODULES" && exit 0
17
18for i in ${!MODULE_*} ; do
19        eval module=\$$i
20        if test -z "$HWMON_MODULES" ; then
21                HWMON_MODULES="$module"
22        else
23                HWMON_MODULES="$HWMON_MODULES $module"
24        fi
25done
26test -z "$HWMON_MODULES" && exit 0
27
28echo >> "$CONFIG"
29echo "# New configuration format generated by sysconfig-lm_sensors-convert" >> "$CONFIG"
30echo "HWMON_MODULES=\"$HWMON_MODULES\"" >> "$CONFIG"
Note: See TracBrowser for help on using the browser.