summaryrefslogtreecommitdiff
path: root/ezjail-config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ezjail-config.sh')
-rw-r--r--ezjail-config.sh26
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
5set -o noglob 3set -o noglob
6if [ -f /config/ezjail.flavour ]; then 4if [ -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
11fi 10fi
12 11
13# set defaults 12# set defaults
14ezjail_flavour_files=${ezjail_flavour_files:-""}
15ezjail_flavour_users=${ezjail_flavour_users:-""} 13ezjail_flavour_users=${ezjail_flavour_users:-""}
14ezjail_flavour_files=${ezjail_flavour_files:-""}
16 15
17# try to create users 16# try to create users
18for user in $ezjail_flavour_users; do 17for user in $ezjail_flavour_users; do
@@ -42,24 +41,25 @@ for user in $ezjail_flavour_users; do
42 fi 41 fi
43done 42done
44 43
45# try to install files 44# chmod all files not belonging to root
46cd /config
47for file in $ezjail_flavour_files; do 45for 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
58done 55done
59 56
60# finally install packages 57# install packages
61set -o noglob 58set -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
65rm -f /etc/rc.d/ezjail-config.sh 65rm -rf /pkg /etc/rc.d/ezjail-config.sh /ezjail.postinstall