summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh')
-rw-r--r--meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh
new file mode 100644
index 000000000..cde0f96ca
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+action=$1
+devpath=$2
+of_fullname=$3
+
+#Use of_fullname if it's there, otherwise use devpath.
+
+path=$of_fullname
+if [ -z "$path" ]
+then
+ path=$devpath
+
+ if [[ "$path" =~ (.*)/hwmon/hwmon[0-9]+$ ]];
+ then
+ path=${BASH_REMATCH[1]}
+ fi
+fi
+
+path="${path//:/--}"
+
+systemctl $action 'xyz.openbmc_project.Hwmon@'$path'.service'
OpenPOWER on IntegriCloud