summaryrefslogtreecommitdiff
path: root/ezjail-config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ezjail-config.sh')
-rw-r--r--ezjail-config.sh48
1 files changed, 0 insertions, 48 deletions
diff --git a/ezjail-config.sh b/ezjail-config.sh
deleted file mode 100644
index 71080e2..0000000
--- a/ezjail-config.sh
+++ /dev/null
@@ -1,48 +0,0 @@
1#!/bin/sh
2
3set -o noglob
4if [ -f /ezjail.flavour ]; then
5 . /ezjail.flavour
6
7 # we do need to install only once delete here to avoid errors
8 # in this script to prevent jail startup forever
9 rm -f /ezjail.flavour
10fi
11
12# set defaults
13ezjail_flavour_users=${ezjail_flavour_users:-""}
14ezjail_flavour_files=${ezjail_flavour_files:-""}
15
16# try to create users, variables named after pw useradd params
17for user in ${ezjail_flavour_users}; do
18 TIFS=${IFS}; IFS=:; set -- ${user}; IFS=${TIFS}
19 if [ $# -eq 8 ]; then
20 u=${2:+-u$2}; G=$3; gs=$4; c=${5:+-c$5}; p=${6:-*}; d=${7#-}; m=${7%%[!-]*}; s=${8:+-s$8};
21
22 # ensure all groups
23 gc=1; for n in `echo -n ${G} | tr , ' '`; do
24 g=`echo -n ${gs} | cut -d , -f ${gc}`
25 pw groupadd -q -n ${n} ${g:+-g${g}}
26 gc=$((1+${gc}))
27 done
28
29 # create user
30 [ $1 ] && echo ${p} | pw useradd -n $1 ${u} ${s} ${m:+-m} ${d:+-d${d}} ${G:+-G${G}} "`echo -n ${c} | tr = ' '`" -H 0
31 fi
32done
33set +o noglob
34
35# chmod all files not belonging to root
36for file in ${ezjail_flavour_files}; do
37 TIFS=${IFS}; IFS=:; set -- ${file}; IFS=${TIFS}
38 [ $# -gt 2 ] && owner="$1:$2" && shift 2 && chown -R ${owner} $*
39done
40
41# install packages
42[ -d /pkg ] && PACKAGESITE=file:// pkg_add -r /pkg/*
43
44# source post install script
45[ -d /ezjail.postinstall ] && . /ezjail.postinstall
46
47# Get rid off ourself
48rm -rf /pkg /etc/rc.d/ezjail-config.sh /ezjail.postinstall