blob: 1270427a6da972b8389ae8b4ead4cb3c52036a93 [file] [log] [blame]
Matt Spinler0066e312018-04-25 10:53:41 -05001#!/bin/sh
2
3# Link in the correct MAX31785 phosphor-hwmon config file to use based on the
4# WaterCooled property, and then start the hwmon service.
5
6# $1: The OF_FULLNAME udev attribute for the MAX31785
7
8base="/etc/default/obmc/hwmon/"$1
9target=$base".conf"
10
11service=$(mapper get-service /xyz/openbmc_project/inventory/system/chassis)
12
13if [ $(busctl get-property $service \
14 /xyz/openbmc_project/inventory/system/chassis \
15 xyz.openbmc_project.Inventory.Decorator.CoolingType \
16 WaterCooled | grep true | wc -l) != 0 ];
17then
18 source=$base'_water.conf'
19else
20 source=$base'_air.conf'
21fi
22
23ln -sf $source $target
24
25instance=$(systemd-escape $1)
26systemctl start xyz.openbmc_project.Hwmon@$instance.service