5 . .
/bin
/khatus_x4_lib_common_sensor.sh
7 dir
="${prefix}/${host}"
10 for pid_file
in $
(find $dir -type f
-name pid
)
12 kill -9 $
(cat $pid_file) || true
15 pkill khatus_x4_sensor || true
19 .
/bin
/khatus_x4_sensor_datetime
&
20 .
/bin
/khatus_x4_sensor_bluetooth
&
21 .
/bin
/khatus_x4_sensor_mpd
&
22 .
/bin
/khatus_x4_sensor_energy
&
37 battery_state
="$(sensor_read_one ${dir}/khatus_x4_sensor_energy/out/battery_state)"
38 battery_percentage
="$(sensor_read_one ${dir}/khatus_x4_sensor_energy/out/battery_percentage)"
39 bluetooth_controllers
="$(sensor_read_one ${dir}/khatus_x4_sensor_bluetooth/out/count_powered_controllers)"
40 bluetooth_devices
="$(sensor_read_one ${dir}/khatus_x4_sensor_bluetooth/out/count_connected_devices)"
41 datetime
="$(sensor_read_one ${dir}/khatus_x4_sensor_datetime/out/datetime)"
42 mpd
="$(sensor_read_one ${dir}/khatus_x4_sensor_mpd/out/status)"
43 echo "E[${battery_state} ${battery_percentage}] [${mpd}] [$bluetooth_controllers $bluetooth_devices] ${datetime}"