summaryrefslogtreecommitdiffstats
path: root/vservers-default
diff options
context:
space:
mode:
Diffstat (limited to 'vservers-default')
-rw-r--r--vservers-default31
1 files changed, 23 insertions, 8 deletions
diff --git a/vservers-default b/vservers-default
index b2ca484..51e5ca4 100644
--- a/vservers-default
+++ b/vservers-default
@@ -16,16 +16,31 @@ fi
name="$(basename "$0")"
# This is a requirement, stated in the init script. So we set it
-# here, to not confuse the user.
+# here, to not bother the user.
LOCKFILE="$name"
-function _get_flavor() {
- local flavor=""
- if [ "$name" = "${name#vserver-default[-.]}" ]; then
-
- else
- fi
-}
+
+# Include default configuration
+if [[ -r "/etc/vservers/.defaults/apps/vserver-startup/default" ]]; then
+ . "/etc/vservers/.defaults/apps/vserver-startup/default"
+fi
+
+
+# Include special configuration for initscript
+if [ "$name" = "${name#vserver-default[-.]}" ]; then
+ falvor="${name#vserver-default[-.]}"
+else
+ flavor="${name#vserver[-.]}"
+fi
+
+if [[ "default" != "$flavor" &&
+ -r "/etc/vservers/.defaults/apps/vserver-startup/$flavor" ]]; then
+ . "/etc/vservers/.defaults/apps/vserver-startup/$flavor"
+fi
+
+unset flavor
+unset name
+
# Added the ability to disable a flaver without disabling the
# initscript. (Debian enables all initscripts during installation