From: Nigel McNie Date: Mon, 2 Apr 2007 09:56:29 +0000 (+1200) Subject: Allow the template files to define __HOST__ that will be replaced with the hostname... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=28ee26ddadad41917fd3bb33124eb82136a49f0a;p=vserverctl.git Allow the template files to define __HOST__ that will be replaced with the hostname of the machine that is the host. --- diff --git a/vserverctl b/vserverctl index 9a96f19..4238b83 100755 --- a/vserverctl +++ b/vserverctl @@ -113,6 +113,7 @@ if ( $action eq 'add' ) { my $data = slurp($key); $data =~ s/__VSNAME__/$vsname/g; $data =~ s/__VSIPADDR__/$ipaddr/g; + $data =~ s/__HOST__/$ENV{HOSTNAME}/g; write_file($vsroot . '.template', $data); system('mv', $vsroot . '.template', $vsroot . $templates{$key} . $file); }