Developing lightweight computation at the DSG edge

Commit fe92d230 authored by p4u's avatar p4u
Browse files

New function to launch hooks

parent 298bf64e
...@@ -228,6 +228,25 @@ qmp_get_dev_from_wifi_mac() { ...@@ -228,6 +228,25 @@ qmp_get_dev_from_wifi_mac() {
done done
} }
#########################
# Hooks related functions
#########################
qmp_hooks_exec() {
local stage="$1"
local device="$(cat /tmp/sysinfo/board_name)"
[ -z "$stage" -o -z "$device" ] && return 1
local hooksdir="/etc/qmp/hooks/$device"
[ -d "$hooksdir" ] && {
for h in $hooksdir/*; do
echo "Executing hook $h in stage $stage"
sh $h $stage
done
}
}
######################### #########################
# Other kind of commands # Other kind of commands
######################### #########################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment