blob: c1ec42e94530baf765b4dde56e14137835c59154 [file] [log] [blame]
Joel Stanley7b29e202017-09-05 17:44:33 +10001#!/bin/bash
2
3action=$1
4devpath=$2
5of_fullname=$3
6
7#Use of_fullname if it's there, otherwise use devpath.
8
9path=$of_fullname
10if [ -z "$path" ]
11then
12 path=$devpath
13
14 if [[ "$path" =~ (.*)/hwmon/hwmon[0-9]+$ ]];
15 then
16 path=${BASH_REMATCH[1]}
17 fi
18fi
19
Lei YUb9f0f682018-12-14 14:33:55 +080020path="${path//:/--}"
Alexander Filippova87fb2d2018-11-23 16:04:49 +030021path="${path//-/\\x2d}"
Joel Stanley7b29e202017-09-05 17:44:33 +100022
23systemctl $action 'xyz.openbmc_project.Hwmon@'$path'.service'