blob: 2e346d0fb380d14833a5a878dab5d051221f989c [file] [log] [blame]
Anton D. Kachalov5b520cf2021-02-03 23:19:39 +01001#!/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
20# Needed to re-do escaping used to avoid bitbake separator conflicts
21path="${path//:/--}"
22# Needed to escape prior to being used as a unit argument
23path="$(systemd-escape "$path")"
24systemctl --no-block "$action" "xyz.openbmc_project.Hwmon@$path.service"