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
3fa358b6
Commit
3fa358b6
authored
Oct 02, 2012
by
p4u
Browse files
Added condition to qmp_set_host to do not rewrite hosts file if the entry already exists
parent
a769cbf2
Changes
1
Show whitespace changes
Inline
Side-by-side
packages/qmp-small-node/files/etc/qmp/qmp_functions.sh
View file @
3fa358b6
...
...
@@ -793,9 +793,11 @@ qmp_set_hosts() {
return
fi
if
[
$(
cat
/etc/hosts |
grep
qmpadmin |
grep
"^
$ip
"
-c
)
-eq
0
]
;
then
cat
/etc/hosts |
grep
-v
qmpadmin
>
/tmp/hosts.tmp
echo
"
$ip
$hn
admin.qmp qmpadmin"
>>
/tmp/hosts.tmp
cp
/tmp/hosts.tmp /etc/hosts
fi
echo
"done"
}
...
...
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