summaryrefslogtreecommitdiff
path: root/ezjail-config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ezjail-config.sh')
-rw-r--r--ezjail-config.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/ezjail-config.sh b/ezjail-config.sh
index 85d35e3..69a93f4 100644
--- a/ezjail-config.sh
+++ b/ezjail-config.sh
@@ -2,6 +2,7 @@
2# 2#
3# BEFORE: rcconf 3# BEFORE: rcconf
4 4
5set -o noglob
5if [ -f /etc/ezjail.flavour ]; then 6if [ -f /etc/ezjail.flavour ]; then
6 . /etc/ezjail.flavour 7 . /etc/ezjail.flavour
7 8
@@ -18,12 +19,11 @@ ezjail_flavour_packages=${ezjail_flavour_packages:-""}
18# try to create users 19# try to create users
19for user in $ezjail_flavour_users; do 20for user in $ezjail_flavour_users; do
20 TIFS=$IFS; IFS=:; set -- $user; IFS=$TIFS 21 TIFS=$IFS; IFS=:; set -- $user; IFS=$TIFS
21
22 if [ $# -eq 8 ]; then 22 if [ $# -eq 8 ]; then
23 gc=1; name=$1; grouplist=$3; gidlist=$4; home=$7 23 gc=1; name=$1; grouplist=$3; gidlist=$4; home=$7
24 24
25 [ $2 ] && uid="-u $2" || uid="" 25 [ $2 ] && uid="-u $2" || uid=""
26 [ $5 ] && comment="-c \"`echo $5 | tr _ ' '`\"" || comment="" 26 [ $5 ] && comment="-c$5" || comment=""
27 [ $6 ] && pass="$6" || pass="*" 27 [ $6 ] && pass="$6" || pass="*"
28 [ $8 ] && shell="-s $8" || shell="" 28 [ $8 ] && shell="-s $8" || shell=""
29 29
@@ -40,7 +40,7 @@ for user in $ezjail_flavour_users; do
40 fi 40 fi
41 # create user 41 # create user
42 [ $grouplist ] && grouplist="-G $grouplist" 42 [ $grouplist ] && grouplist="-G $grouplist"
43 [ $name ] && echo "$pass" | pw useradd -n $name $uid $shell $mkhome $home $grouplist $comment -H 0 43 [ $name ] && echo "$pass" | pw useradd -n $name $uid $shell $mkhome $home $grouplist "`echo $comment | tr = ' '`" -H 0
44 fi 44 fi
45done 45done
46 46
@@ -48,18 +48,20 @@ done
48cd $ezjail_flavour_root 48cd $ezjail_flavour_root
49for file in $ezjail_flavour_files; do 49for file in $ezjail_flavour_files; do
50 TIFS=$IFS; IFS=:; set -- $file; IFS=$TIFS 50 TIFS=$IFS; IFS=:; set -- $file; IFS=$TIFS
51 51 set +o noglob
52 if [ $# -eq 3 -a "$3" ]; then 52 if [ $# -eq 3 -a "$3" ]; then
53 owner=$1; [ $2 ] && owner="$1:$2" 53 owner=$1; [ $2 ] && owner="$1:$2"
54 for file in $3; do 54 for file in ./$3; do
55 find ${file#/} | cpio -p -l -d / 55 find ${file} | cpio -p -d /
56 chown -R $owner $file 56 chown -R $owner /$file
57 done 57 done
58 fi 58 fi
59 set -o noglob
59done 60done
60 61
61# finally install packages 62# finally install packages
62[ -d /basejail/config/pkg ] && cd /basejail/config/pkg 63[ -d /basejail/config/pkg ] && cd /basejail/config/pkg
64set +o noglob
63[ "${ezjail_flavour_packages}" ] && pkg_add ${ezjail_flavour_packages} 65[ "${ezjail_flavour_packages}" ] && pkg_add ${ezjail_flavour_packages}
64 66
65# Get rid off ourself 67# Get rid off ourself