????

Your IP : 18.226.164.216


Current Path : /usr/bin/
Upload File :
Current File : //usr/bin/sysconfig-lm_sensors-convert

#!/bin/sh

# Convert an lm_sensors service configuration file from the old convention
# (MODULE_0, MODULE_1...) to the new convention (HWMON_MODULES).
#
# Copyright (C) 2009  Jean Delvare <khali@linux-fr.org>
#
# Released without a license on purpose. This is public domain code, so
# that package maintainers can include it in their post-install script.

CONFIG=/etc/sysconfig/lm_sensors
test -r "$CONFIG" || exit

unset ${!MODULE_*} $HWMON_MODULES
. "$CONFIG"
test -n "$HWMON_MODULES" && exit

for i in ${!MODULE_*} ; do
	eval module=\$$i
	if test -z "$HWMON_MODULES" ; then
		HWMON_MODULES="$module"
	else
		HWMON_MODULES="$HWMON_MODULES $module"
	fi
done
test -z "$HWMON_MODULES" && exit

echo >> "$CONFIG"
echo "# New configuration format generated by sysconfig-lm_sensors-convert" >> "$CONFIG"
echo "HWMON_MODULES=\"$HWMON_MODULES\"" >> "$CONFIG"