summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2005-11-17 00:30:15 +0000
committererdgeist <erdgeist@erdgeist.org>2005-11-17 00:30:15 +0000
commit9becc61bb321fc16d3ba5778e2ef5078efd07d22 (patch)
treef35b6cf8c41ea0bc834e83256fa1dd53fdf136fc /ezjail-admin
parente73cd9344284a5bb99a4977c0e4b6b278f051a2e (diff)
Default PREFIX provided, flavour stuff added
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin14
1 files changed, 13 insertions, 1 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 907a61f..d9fce50 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -3,6 +3,7 @@
3# ugly: this variable is set during port install time 3# ugly: this variable is set during port install time
4ezjail_prefix=EZJAIL_PREFIX 4ezjail_prefix=EZJAIL_PREFIX
5ezjail_etc=${ezjail_prefix}/etc 5ezjail_etc=${ezjail_prefix}/etc
6ezjail_share=${ezjail_prefix}/share
6ezjail_jailcfgs=${ezjail_etc}/ezjail 7ezjail_jailcfgs=${ezjail_etc}/ezjail
7 8
8if [ -f ${ezjail_etc}/ezjail.conf ]; then 9if [ -f ${ezjail_etc}/ezjail.conf ]; then
@@ -95,9 +96,12 @@ create)
95 # if flavour contains a '/', it aint a short name 96 # if flavour contains a '/', it aint a short name
96 if [ ${newjail_flavour} = ${newjail_flavour%/*} -a \ 97 if [ ${newjail_flavour} = ${newjail_flavour%/*} -a \
97 -f ${ezjail_etc}/ezjail.flavour.${newjail_flavour} ]; then 98 -f ${ezjail_etc}/ezjail.flavour.${newjail_flavour} ]; then
98 [ $newjail_flav ] && exerr "Note: flavour ${newjail_flavour} conflicts with file ./${newjail_flavour}" 99 [ "$newjail_flav" ] && exerr "Error: flavour ${newjail_flavour} conflicts with file ./${newjail_flavour}"
99 $newjail_flav=${ezjail_etc}/ezjail.flavour.${newjail_flavour} 100 $newjail_flav=${ezjail_etc}/ezjail.flavour.${newjail_flavour}
100 fi 101 fi
102
103 # Flavour not found
104 [ "$newjail_flav" ] || exerr "Error: Flavour file $newjail_flavour not found"
101 fi 105 fi
102 106
103 # now take a copy of our template jail 107 # now take a copy of our template jail
@@ -126,6 +130,13 @@ create)
126 echo export jail_${newjail_nname}_procfs_enable=\"${ezjail_procfs_enable}\" >> ${ezjail_jailcfgs}/${newjail_nname} 130 echo export jail_${newjail_nname}_procfs_enable=\"${ezjail_procfs_enable}\" >> ${ezjail_jailcfgs}/${newjail_nname}
127 echo export jail_${newjail_nname}_fdescfs_enable=\"${ezjail_fdescfs_enable}\" >> ${ezjail_jailcfgs}/${newjail_nname} 131 echo export jail_${newjail_nname}_fdescfs_enable=\"${ezjail_fdescfs_enable}\" >> ${ezjail_jailcfgs}/${newjail_nname}
128 132
133 # Final steps for flavour installation
134 if [ "${newjail_flav}" ]; then
135 install -o root -g wheel -m 0755 ${newjail_flav} ${newjail_root}/ezjail.flavour
136 install -o root -g wheel -m 0755 ${ezjail_share}/ezjail-config.sh ${newjail_root}/etc/rc.d/ezjail-config.sh
137 echo "Shell scripts installed, flavourizing on jails first startup"
138 fi
139
129 ;; 140 ;;
130delete) 141delete)
131######################## ezjail-admin DELETE ######################## 142######################## ezjail-admin DELETE ########################
@@ -190,6 +201,7 @@ list)
190 eval jail_rootdir=\"\$jail_${jail}_rootdir\" 201 eval jail_rootdir=\"\$jail_${jail}_rootdir\"
191 printf "%-15s %-28s %s\\n" $jail_ip $jail_hostname $jail_rootdir 202 printf "%-15s %-28s %s\\n" $jail_ip $jail_hostname $jail_rootdir
192 done 203 done
204
193 ;; 205 ;;
194setup|update) 206setup|update)
195######################## ezjail-admin UPDATE ######################## 207######################## ezjail-admin UPDATE ########################