summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2008-10-22 15:54:15 +0000
committererdgeist <erdgeist@erdgeist.org>2008-10-22 15:54:15 +0000
commit5b37381e7672d92ad037516df7f2091cbab20ddb (patch)
tree7febc397d41b87d673dc1b526712f75927364805 /ezjail-admin
parentefc8152d7863a47f24d8c420d721c050b7612f44 (diff)
Setting defaults the more elegant bourne shell style
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin42
1 files changed, 21 insertions, 21 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 3d4d148..23acb49 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -13,22 +13,22 @@ ezjail_jailcfgs="${ezjail_etc}/ezjail"
13[ -f "${ezjail_etc}/ezjail.conf" ] && . "${ezjail_etc}/ezjail.conf" 13[ -f "${ezjail_etc}/ezjail.conf" ] && . "${ezjail_etc}/ezjail.conf"
14 14
15# set defaults 15# set defaults
16ezjail_jaildir=${ezjail_jaildir:-"/usr/jails"} 16: ${ezjail_jaildir="/usr/jails"}
17ezjail_jailtemplate=${ezjail_jailtemplate:-"${ezjail_jaildir}/newjail"} 17: ${ezjail_jailtemplate="${ezjail_jaildir}/newjail"}
18ezjail_jailbase=${ezjail_jailbase:-"${ezjail_jaildir}/basejail"} 18: ${ezjail_jailbase="${ezjail_jaildir}/basejail"}
19ezjail_jailfull=${ezjail_jailfull:-"${ezjail_jaildir}/fulljail"} 19: ${ezjail_jailfull="${ezjail_jaildir}/fulljail"}
20ezjail_jailtemp=${ezjail_jailtemp:-"${ezjail_jaildir}/ezjailtemp"} 20: ${ezjail_jailtemp="${ezjail_jaildir}/ezjailtemp"}
21ezjail_flavours=${ezjail_flavours:-"${ezjail_jaildir}/flavours"} 21: ${ezjail_flavours="${ezjail_jaildir}/flavours"}
22ezjail_portscvsroot=${ezjail_portscvsroot:-"freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs"} 22: ${ezjail_portscvsroot="freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs"}
23ezjail_sourcetree=${ezjail_sourcetree:-"/usr/src"} 23: ${ezjail_sourcetree="/usr/src"}
24ezjail_uglyperlhack=${ezjail_uglyperlhack:-"YES"} 24: ${ezjail_uglyperlhack="YES"}
25ezjail_default_execute=${ezjail_default_execute:-"/usr/bin/login -f root"} 25: ${ezjail_default_execute="/usr/bin/login -f root"}
26 26
27ezjail_mount_enable=${ezjail_mount_enable:-"YES"} 27: ${ezjail_mount_enable="YES"}
28ezjail_devfs_enable=${ezjail_devfs_enable:-"YES"} 28: ${ezjail_devfs_enable="YES"}
29ezjail_devfs_ruleset=${ezjail_devfs_ruleset:-"devfsrules_jail"} 29: ${ezjail_devfs_ruleset="devfsrules_jail"}
30ezjail_procfs_enable=${ezjail_procfs_enable:-"YES"} 30: ${ezjail_procfs_enable="YES"}
31ezjail_fdescfs_enable=${ezjail_fdescfs_enable:-"YES"} 31: ${ezjail_fdescfs_enable="YES"}
32 32
33ezjail_dirlist="bin boot lib libexec rescue sbin usr/bin usr/games usr/include usr/lib usr/libdata usr/libexec usr/sbin usr/src usr/share" 33ezjail_dirlist="bin boot lib libexec rescue sbin usr/bin usr/games usr/include usr/lib usr/libdata usr/libexec usr/sbin usr/src usr/share"
34ezjail_basesystem="base" 34ezjail_basesystem="base"
@@ -334,7 +334,7 @@ create)
334 c) ezjail_imagetype=${OPTARG};; 334 c) ezjail_imagetype=${OPTARG};;
335 C) ezjail_imageparams=${OPTARG};; 335 C) ezjail_imageparams=${OPTARG};;
336 b) ezjail_forceblocking="YES";; 336 b) ezjail_forceblocking="YES";;
337 i) ezjail_imagetype=${ezjail_imagetype:-"simple"};; 337 i) : ${ezjail_imagetype="simple"};;
338 s) ezjail_imagesize=${OPTARG};; 338 s) ezjail_imagesize=${OPTARG};;
339 ?) exerr ${ezjail_usage_create};; 339 ?) exerr ${ezjail_usage_create};;
340 esac; done; shift $(( ${OPTIND} - 1 )) 340 esac; done; shift $(( ${OPTIND} - 1 ))
@@ -371,7 +371,7 @@ create)
371 371
372 ezjail_hostname=`echo -n "${ezjail_name}" | tr '/~' '__'` 372 ezjail_hostname=`echo -n "${ezjail_name}" | tr '/~' '__'`
373 ezjail_safename=`echo -n "${ezjail_name}" | tr -c '[:alnum:]' _` 373 ezjail_safename=`echo -n "${ezjail_name}" | tr -c '[:alnum:]' _`
374 ezjail_rootdir=${ezjail_rootdir:-"${ezjail_jaildir}/${ezjail_hostname}"} 374 : ${ezjail_rootdir="${ezjail_jaildir}/${ezjail_hostname}"}
375 ezjail_config="${ezjail_jailcfgs}/${ezjail_safename}" 375 ezjail_config="${ezjail_jailcfgs}/${ezjail_safename}"
376 376
377 # This scenario really will only lead to real troubles in the 'fulljail' 377 # This scenario really will only lead to real troubles in the 'fulljail'
@@ -726,7 +726,7 @@ install)
726 [ $# -eq 0 ] || exerr ${ezjail_usage_install} 726 [ $# -eq 0 ] || exerr ${ezjail_usage_install}
727 727
728 ezjail_installarch=`uname -p` 728 ezjail_installarch=`uname -p`
729 ezjail_ftphost=${ezjail_ftphost:-"ftp.freebsd.org"} 729 : ${ezjail_ftphost="ftp.freebsd.org"}
730 ezjail_ftphost=${ezjail_ftphost#ftp://} 730 ezjail_ftphost=${ezjail_ftphost#ftp://}
731 ezjail_dir=${ezjail_ftphost#file://} 731 ezjail_dir=${ezjail_ftphost#file://}
732 [ "${ezjail_dir%%[!/]*}" ] || ezjail_reldir=`pwd -P` 732 [ "${ezjail_dir%%[!/]*}" ] || ezjail_reldir=`pwd -P`
@@ -857,7 +857,7 @@ archive)
857 [ $# -lt 1 -a -z "${ezjail_archivealljails}" ] && exerr ${ezjail_usage_archive} 857 [ $# -lt 1 -a -z "${ezjail_archivealljails}" ] && exerr ${ezjail_usage_archive}
858 858
859 # Default archive directory to . 859 # Default archive directory to .
860 ezjail_archivedir=${ezjail_archivedir:-`pwd -P`} 860 : ${ezjail_archivedir=`pwd -P`}
861 861
862 # Will not backup more than one jail per archive 862 # Will not backup more than one jail per archive
863 [ "${ezjail_archive}" -a "${ezjail_archivealljails}" ] && exerr "Error: Must not specify an archive location for multiple archives.\n Can not archive multiple jails into one archive." 863 [ "${ezjail_archive}" -a "${ezjail_archivealljails}" ] && exerr "Error: Must not specify an archive location for multiple archives.\n Can not archive multiple jails into one archive."
@@ -962,7 +962,7 @@ restore)
962 [ $# -eq 0 ] && exerr ${ezjail_usage_restore} 962 [ $# -eq 0 ] && exerr ${ezjail_usage_restore}
963 963
964 # Default archive directory to . 964 # Default archive directory to .
965 ezjail_archivedir=${ezjail_archivedir:-`pwd -P`} 965 : ${ezjail_archivedir=`pwd -P`}
966 966
967 for ezjail_fromarchive in $@; do 967 for ezjail_fromarchive in $@; do
968 unset ezjail_safename ezjail_imagedata ezjail_nameprop 968 unset ezjail_safename ezjail_imagedata ezjail_nameprop