mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-15 10:39:31 +00:00
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3252 7894878c-1315-0410-8ee3-d5d059ff63e0
33 lines
677 B
Bash
Executable File
33 lines
677 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Here you can set several defaults.
|
|
|
|
# The number of devices to create (max: 256)
|
|
# If not provided on the command line, default to 32
|
|
NUMBER=${1:-32}
|
|
|
|
# The owner and group of the devices
|
|
OUSER=root
|
|
OGROUP=root
|
|
# The mode of the devices
|
|
MODE=600
|
|
|
|
# This script doesn't need to be run if devfs is used
|
|
if [ -r /proc/mounts ] ; then
|
|
if grep -q "/dev devfs" /proc/mounts ; then
|
|
echo "You do not need to run this script as your system uses devfs."
|
|
exit;
|
|
fi
|
|
fi
|
|
|
|
i=0;
|
|
|
|
while [ $i -lt $NUMBER ] ; do
|
|
if [ ! -c /dev/i2c-$i ] ; then
|
|
echo /dev/i2c-$i
|
|
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
|
|
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
|
|
fi
|
|
i=$[$i + 1]
|
|
done
|