home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add issue to fix - handle multiple batteries
[khatus.git]
/
src
/
awk
/
exe
/
actuate_device_add_to_automount.awk
diff --git
a/src/awk/exe/actuate_device_add_to_automount.awk
b/src/awk/exe/actuate_device_add_to_automount.awk
old mode 100755
(executable)
new mode 100644
(file)
index
9db7e9e
..
3683370
--- a/
src/awk/exe/actuate_device_add_to_automount.awk
+++ b/
src/awk/exe/actuate_device_add_to_automount.awk
@@
-3,11
+3,17
@@
BEGIN {
Execute_On_Mount = Execute_On_Mount ? Execute_On_Mount : ""
}
Execute_On_Mount = Execute_On_Mount ? Execute_On_Mount : ""
}
-$1 == "OK" && \
-$2 == "khatus_sensor_devices" && \
-$3 == "add" && \
-$4 ~ /[0-9]$/ {
- mount_device($4)
+{
+ delete msg
+ msg_parse(msg, $0)
+}
+
+msg["node"] == Node && \
+msg["module"] == "khatus_sensor_devices" && \
+msg["type"] == "data" && \
+msg["key"] == "add" && \
+msg["val"] ~ /[0-9]$/ {
+ mount_device(msg["val"])
}
function mount_device(path, cmd, line, lines, line_count, status, i,
}
function mount_device(path, cmd, line, lines, line_count, status, i,
@@
-28,15
+34,15
@@
function mount_device(path, cmd, line, lines, line_count, status, i,
path_mnt=line
sub("^Mounted " path_dev " at ", "", path_mnt)
sub("\.$", "", path_mnt)
path_mnt=line
sub("^Mounted " path_dev " at ", "", path_mnt)
sub("\.$", "", path_mnt)
-
alert("low",
"successfully-mounted", path_dev " to " path_mnt)
+
msg_out_alert_low(
"successfully-mounted", path_dev " to " path_mnt)
if (Execute_On_Mount) {
system(Execute_On_Mount " '" path_mnt "'")
}
} else {
if (Execute_On_Mount) {
system(Execute_On_Mount " '" path_mnt "'")
}
} else {
-
alert("hi",
"unexpected-success-line", line)
+
msg_out_alert_hi(
"unexpected-success-line", line)
}
}
} else {
}
}
} else {
-
alert("hi",
"failed-to-mount-device", path)
+
msg_out_alert_hi(
"failed-to-mount-device", path)
}
}
}
}
This page took
0.027557 seconds
and
4
git commands to generate.