diff options
author | erdgeist <erdgeist@erdgeist.org> | 2005-12-31 01:50:10 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2005-12-31 01:50:10 +0000 |
commit | 523224e63efeb74fc0bbd038a25a10772756ca46 (patch) | |
tree | 5b8f2601b204ca06cf23bf1207d27ed88965c2b9 /ezjail-config.sh | |
parent | ddbf80c98fe09ea26c09cf4a9e04e5f8fb383c1c (diff) |
Flavours now head to their final layout:
the whole bunch of stuff found below flavour dir is being installed into the new jails root, including the flavour config, packages and files.
The startup scripts now only creates users, chowns the files it is told to and installs packages.
Diffstat (limited to 'ezjail-config.sh')
-rw-r--r-- | ezjail-config.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ezjail-config.sh b/ezjail-config.sh index 19aa801..e7e9d9c 100644 --- a/ezjail-config.sh +++ b/ezjail-config.sh | |||
@@ -1,18 +1,17 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | ||
3 | # BEFORE: rcconf | ||
4 | 2 | ||
5 | set -o noglob | 3 | set -o noglob |
6 | if [ -f /config/ezjail.flavour ]; then | 4 | if [ -f /ezjail.flavour ]; then |
7 | . /config/ezjail.flavour | 5 | . /ezjail.flavour |
8 | 6 | ||
9 | # we do need to install only once | 7 | # we do need to install only once delete here to avoid errors |
10 | rm -f /config/ezjail.flavour | 8 | # in this script to prevent jail startup forever |
9 | rm -f /ezjail.flavour | ||
11 | fi | 10 | fi |
12 | 11 | ||
13 | # set defaults | 12 | # set defaults |
14 | ezjail_flavour_files=${ezjail_flavour_files:-""} | ||
15 | ezjail_flavour_users=${ezjail_flavour_users:-""} | 13 | ezjail_flavour_users=${ezjail_flavour_users:-""} |
14 | ezjail_flavour_files=${ezjail_flavour_files:-""} | ||
16 | 15 | ||
17 | # try to create users | 16 | # try to create users |
18 | for user in $ezjail_flavour_users; do | 17 | for user in $ezjail_flavour_users; do |
@@ -42,24 +41,25 @@ for user in $ezjail_flavour_users; do | |||
42 | fi | 41 | fi |
43 | done | 42 | done |
44 | 43 | ||
45 | # try to install files | 44 | # chmod all files not belonging to root |
46 | cd /config | ||
47 | for file in $ezjail_flavour_files; do | 45 | for file in $ezjail_flavour_files; do |
48 | TIFS=$IFS; IFS=:; set -- $file; IFS=$TIFS | 46 | TIFS=$IFS; IFS=:; set -- $file; IFS=$TIFS |
49 | set +o noglob | 47 | set +o noglob |
50 | if [ $# -eq 3 -a "$3" ]; then | 48 | if [ $# -eq 3 -a "$3" ]; then |
51 | owner=$1; [ $2 ] && owner="$1:$2" | 49 | owner=$1; [ $2 ] && owner="$1:$2" |
52 | for file in ./$3; do | 50 | for file in ./$3; do |
53 | find ${file} | cpio -p -d / | ||
54 | chown -R $owner /$file | 51 | chown -R $owner /$file |
55 | done | 52 | done |
56 | fi | 53 | fi |
57 | set -o noglob | 54 | set -o noglob |
58 | done | 55 | done |
59 | 56 | ||
60 | # finally install packages | 57 | # install packages |
61 | set -o noglob | 58 | set -o noglob |
62 | [ -d /config/pkg ] && cd /config/pkg && pkg_add * | 59 | [ -d /pkg ] && cd /pkg && pkg_add * |
60 | |||
61 | # source post install script | ||
62 | [ -d /ezjail.postinstall ] && . /ezjail.postinstall | ||
63 | 63 | ||
64 | # Get rid off ourself | 64 | # Get rid off ourself |
65 | rm -f /etc/rc.d/ezjail-config.sh | 65 | rm -rf /pkg /etc/rc.d/ezjail-config.sh /ezjail.postinstall |