Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Quick Mesh Project
qMp packages
Commits
26e0a50b
Commit
26e0a50b
authored
Jul 15, 2013
by
p4u
Browse files
Moved qmp_is_in into qmp_common
Small changes
parent
c5ca9d17
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/qmp-system/files/etc/qmp/qmp_common.sh
View file @
26e0a50b
...
...
@@ -60,13 +60,15 @@ qmp_uci_set() {
}
qmp_uci_set_raw
()
{
uci
-q
set
$@
>
/dev/null
local
a
=
$(
echo
"
$@
"
|
cut
-d
=
-f1
)
local
b
=
$(
echo
"
$@
"
|
cut
-d
=
-f2
)
[
-n
"
$b
"
]
&&
uci
-q
set
$a
=
"
$b
"
||
uci
-q
set
$@
2>/dev/null
r
=
$?
uci commit
r
=
$((
$r
+
$?
))
[
$r
-ne
0
]
&&
logger
-t
qMp
"UCI returned an error (uci set
$@
)"
qmp_debug
"qmp_uci_set_raw: uci -q set
$@
"
return
$r
return
$r
}
qmp_uci_del
()
{
...
...
@@ -151,8 +153,7 @@ qmp_uci_import() {
}
qmp_uci_test
()
{
option
=
$@
u
=
"
$(
uci get
$option
>
/dev/null 2>&1
)
"
u
=
"
$(
uci
-q
get
$@
2>&1
)
"
r
=
$?
return
$r
}
...
...
@@ -287,3 +288,18 @@ qmp_get_netid_from_network() {
echo
"
$(
ipcalc.sh
$1
$2
|
grep
NETWORK |
cut
-d
=
-f2
)
"
}
# TO-EXPLAIN
qmp_is_in
()
{
local
search
=
"
$1
"
shift
local
item
for
item
in
$@
do
if
[
"
$search
"
==
"
$item
"
]
then
return
0
fi
done
return
1
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment