~ubuntu-branches/debian/sid/vzctl/sid

« back to all changes in this revision

Viewing changes to etc/dists/scripts/postcreate.sh

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2011-10-17 06:51:28 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20111017065128-vgdwvq5lei9g4mc7
Tags: 3.0.29.3-1
New upstream release.
Closes: #638072.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
 
1
#!/bin/sh
2
2
#  Copyright (C) 2000-2011, Parallels, Inc. All rights reserved.
3
3
#
4
4
#  This program is free software; you can redistribute it and/or modify
23
23
# 3. Seeds /etc/hosts with localhost entries for IPv4 and IPv6
24
24
# 4. Creates empty /etc/resolv.conf
25
25
 
26
 
function randcrontab()
 
26
randcrontab()
27
27
{
28
 
        local file=${VE_ROOT}"/etc/crontab"
29
 
 
30
 
        [ -f "${file}" ] || return 0
31
 
 
32
 
        /bin/cp -fp ${file} ${file}.$$
33
 
        cat ${file} | awk '
 
28
        local file
 
29
        for file in ${VE_ROOT}/etc/crontab ${VE_ROOT}/etc/cron.d/*; do
 
30
                [ -f "${file}" ] || continue
 
31
 
 
32
                /bin/cp -fp ${file} ${file}.$$
 
33
                cat ${file} | awk '
34
34
BEGIN { srand(); }
35
35
{
36
36
        if ($0 ~ /^[ \t]*#/ || $0 ~ /^[ \t]+*$/) {
61
61
                line = line " "  ar[i];
62
62
        }
63
63
        print line;
64
 
}
65
 
' > ${file}.$$ && /bin/mv -f ${file}.$$ ${file}
66
 
        /bin/rm -f ${file}.$$ 2>/dev/null
 
64
}' >            ${file}.$$ && /bin/mv -f ${file}.$$ ${file}
 
65
                /bin/rm -f ${file}.$$ 2>/dev/null
 
66
        done
67
67
}
68
68
 
69
 
function disableroot()
 
69
disableroot()
70
70
{
71
71
        local file=${VE_ROOT}"/etc/passwd"
72
72
 
79
79
        fi
80
80
}
81
81
 
82
 
function set_network()
 
82
set_network()
83
83
{
84
84
        local file=${VE_ROOT}"/etc/hosts"
85
85
        if ! grep -qw '127.0.0.1' ${file} 2>/dev/null; then