diff options
author | des <des@FreeBSD.org> | 2004-08-19 08:55:24 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-08-19 08:55:24 +0000 |
commit | aedf82c640457ff690bb1488d80aa65930350410 (patch) | |
tree | 50a7b5fc0f4c58e5ea92ad14ec544980c1d020a6 /etc/rc.d/jail | |
parent | 736d98ed0430072fbfd210a5a383cd97aeb6cb94 (diff) | |
download | FreeBSD-src-aedf82c640457ff690bb1488d80aa65930350410.zip FreeBSD-src-aedf82c640457ff690bb1488d80aa65930350410.tar.gz |
Always quote variables in tests, to ensure correct evaluation even when
they are empty or undefined.
MFC after: 3 days
Diffstat (limited to 'etc/rc.d/jail')
-rw-r--r-- | etc/rc.d/jail | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/rc.d/jail b/etc/rc.d/jail index f344e96..addb2e7 100644 --- a/etc/rc.d/jail +++ b/etc/rc.d/jail @@ -94,17 +94,17 @@ set_sysctl() jail_umount_fs() { if checkyesno jail_fdescfs; then - if [ -d ${jail_fdescdir} ] ; then + if [ -d "${jail_fdescdir}" ] ; then umount -f ${jail_fdescdir} >/dev/null 2>&1 fi fi if checkyesno jail_devfs; then - if [ -d ${jail_devdir} ] ; then + if [ -d "${jail_devdir}" ] ; then umount -f ${jail_devdir} >/dev/null 2>&1 fi fi if checkyesno jail_procfs; then - if [ -d ${jail_procdir} ] ; then + if [ -d "${jail_procdir}" ] ; then umount -f ${jail_procdir} >/dev/null 2>&1 fi fi @@ -132,7 +132,7 @@ jail_start() devfs_mount_jail "${jail_devdir}" ${jail_ruleset} # Transitional symlink for old binaries - if [ ! -L ${jail_devdir}/log ]; then + if [ ! -L "${jail_devdir}/log" ]; then __pwd="`pwd`" cd "${jail_devdir}" ln -sf ../var/run/log log @@ -153,7 +153,7 @@ jail_start() fi if checkyesno jail_procfs; then info "Mounting procfs onto ${jail_procdir}" - if [ -d ${jail_procdir} ] ; then + if [ -d "${jail_procdir}" ] ; then mount -t procfs proc "${jail_procdir}" fi fi @@ -175,9 +175,9 @@ jail_stop() echo -n 'Stopping jails:' for _jail in ${jail_list} do - if [ -f /var/run/jail_${_jail}.id ]; then + if [ -f "/var/run/jail_${_jail}.id" ]; then _jail_id=$(cat /var/run/jail_${_jail}.id) - if [ ! -z ${_jail_id} ]; then + if [ ! -z "${_jail_id}" ]; then init_variables $_jail killall -j ${_jail_id} -TERM > /dev/null 2>&1 jail_umount_fs |