blob: cde0f96ca671df3bc74fcaee922d56e9a7c0a7dd [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
20path="${path//:/--}"
21
22systemctl $action 'xyz.openbmc_project.Hwmon@'$path'.service'