summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xezjail-admin43
1 files changed, 41 insertions, 2 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 613e73b..19725d2 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -11,12 +11,51 @@ if [ -f ${ezjail_prefix}/etc/ezjail.conf ]; then
11 . ${ezjail_prefix}/etc/ezjail.conf; 11 . ${ezjail_prefix}/etc/ezjail.conf;
12fi 12fi
13 13
14# set defaults
15ezjail_jaildir=${ezjail_jaildir:-"/usr/jails"}
16ezjail_jailtemplate=${ezjail_jailtemplate:-"$ezjail_jaildir/newjail"}
17ezjail_jailbase=${ezjail_jailbase:-"$ezjail_jaildir/basejail"}
18ezjail_sourcetree=${ezjail_sourcetree:-"/usr/src"}
19
20ezjail_mount_enable=${ezjail_mount_enable:-"YES"}
21ezjail_devfs_enable=${ezjail_devfs_enable:-"YES"}
22ezjail_devfs_ruleset=${ezjail_devfs_ruleset:-"devfsrules_jail"}
23ezjail_procfs_enable=${ezjail_procfs_enable:-"YES"}
24ezjail_fdescfs_enable=${ezjail_fdescfs_enable:-"YES"}
25
26# check for command
14if [ -z "$1" ]; 27if [ -z "$1" ];
15 then echo "Syntax: `basename $0` [create|delete|list|update] {params}"; exit; 28 then echo "Usage: `basename $0` [create|delete|list|update] {params}"; exit;
16fi 29fi
17 30
18case "$1" in 31case "$1" in
19create) 32create)
33 shift
34 args=`getopt xr: $*`
35 if [ $? != 0 ]; then
36 echo 'Usage: ezjail create [-r jailroot] [-x] jailname jailip'; exit 1;
37 fi
38
39 newjail_root=
40 newjail_fill="YES"
41
42 for arg in args; do
43 case $arg in
44 -x) newjail_fill="NO"; shift;;
45 -r) newjail_root="$2"; shift 2;;
46 --) shift; break;;
47 esac
48 done;
49 newjail_name=$1; newjail_ip=$2; shift 2;
50
51 if [ -z "$newjail_name" -o -z "$newjail_ip" -o $# != 0 ]; then
52 echo 'Usage: ezjail create [-r jailroot] [-x] jailname jailip'; exit 1;
53 fi
54
55 echo running CREATE $newjail_name $newjail_ip $newjail_fill
56
57 exit
58
20 mkdir ${newjail_root} && cd ${ezjail_jailtemplate} \ 59 mkdir ${newjail_root} && cd ${ezjail_jailtemplate} \
21 && find * | cpio -p -v ${newjail_root} 60 && find * | cpio -p -v ${newjail_root}
22 ;; 61 ;;
@@ -52,6 +91,6 @@ update)
52 91
53 ;; 92 ;;
54*) 93*)
55 echo "Syntax: `basename $0` [create|delete|list|update] {params}"; exit; 94 echo "Usage: `basename $0` [create|delete|list|update] {params}"; exit;
56 ;; 95 ;;
57esac 96esac