projects
/
matthijs
/
servers
/
drsnuggles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
10284ea
)
vserver: Make the vserver-create script update the dns verserver's hosts file.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 16 Oct 2008 14:23:52 +0000
(16:23 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 16 Oct 2008 14:23:52 +0000
(16:23 +0200)
usr/local/bin/vserver-create
patch
|
blob
|
history
diff --git
a/usr/local/bin/vserver-create
b/usr/local/bin/vserver-create
index 7311ab185534a9b3367a162df1afbb502320ed2a..cd621d53fb6c65ce51b6d6946de72d5e8c384043 100755
(executable)
--- a/
usr/local/bin/vserver-create
+++ b/
usr/local/bin/vserver-create
@@
-14,6
+14,10
@@
IP_RANGE=10.42.0.
INTERFACE=dummy0
# The netmask for the address
NETMASK=24
INTERFACE=dummy0
# The netmask for the address
NETMASK=24
+HOSTS_VSERVER=dns
+# The hosts file to which an entry for the new vserver should be added. Can be
+# left empty to not record the new vserver anywhere.
+HOSTS_FILE=$VSERVERS_CONF/$HOSTS_VSERVER/vdir/etc/hosts
function usage()
{
function usage()
{
@@
-79,3
+83,7
@@
CONF_FOR_GIT=`echo $VSERVERS_CONF/$NAME | sed "s#^/*##"`
# Commit the configuration
(cd /; git add $CONF_FOR_GIT)
(cd /; git commit $CONF_FOR_GIT --edit --message "vserver: Add $NAME vserver configuration.")
# Commit the configuration
(cd /; git add $CONF_FOR_GIT)
(cd /; git commit $CONF_FOR_GIT --edit --message "vserver: Add $NAME vserver configuration.")
+
+if [ -n "$HOSTS_FILE" ]; then
+ sudo sh -c "echo '$IP $NAME' >> '$HOSTS_FILE'"
+fi