Skip to content

Instantly share code, notes, and snippets.

@smallfield
Last active December 21, 2015 03:58
Show Gist options
  • Save smallfield/6245515 to your computer and use it in GitHub Desktop.
Save smallfield/6245515 to your computer and use it in GitHub Desktop.
#!/bin/sh
chinachu_home="/home/chinachu/chinachu/"
tuners="BSCS-1 BSCS-2 GR-1 GR-2"
tunercount=`echo ${tuners} | wc -w`
i=0
if [ $1 = "config" ]
then
cat <<'EOM'
graph_title Tuner lock
graph_vlabel Tuner count
EOM
for tuner in $tuners
do
echo "tuner${i}.label ${tuner}"
echo "tuner${i}.draw AREASTACK"
i=$(( $i + 1 ))
done
exit 0
fi
while [ $i -lt $tunercount ]
do
echo -n "tuner${i}.value "
if [ -e "${chinachu_home}/data/tuner.${i}.lock" ]
then
echo 1
else
echo 0
fi
i=$(( $i + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment