summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xezjail-admin17
1 files changed, 10 insertions, 7 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 9d8b2a6..01369bb 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -154,20 +154,22 @@ ezjail_updateports () {
154# Try to fetch the list of releases the server provides 154# Try to fetch the list of releases the server provides
155ezjail_queryftpserver () { 155ezjail_queryftpserver () {
156 unset _ret 156 unset _ret
157 echo -n "Querying your ftp-server... "
157 TIFS=${IFS}; IFS= 158 TIFS=${IFS}; IFS=
158 for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do 159 for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do
159 if [ ${ezjail_path} = "NO" ]; then 160 if [ ${ezjail_path} = "NO" ]; then
160 echo "Warning: I am having problems querying the ftp server you specified (${ezjail_ftphost})." 161 echo "Warning: I am having problems querying the ftp server you specified (${ezjail_ftphost})."
161 _ret=1; break 162 _ret=1; break
162 fi 163 fi
163 ezjail_ftpresponse=`echo ls | ftp ${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/ 2> /dev/null` 164 ezjail_ftpresponse=`echo ls | ftp ${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/ 2> /dev/null` 2> /dev/null
164 if [ $? -eq 0 ]; then 165 if [ $? -eq 0 ]; then
165 echo -e "The ftp server you specified (${ezjail_ftphost}) seems to provide the following builds:\n${ezjail_ftpresponse}\n." 166 echo -e "The ftp server you specified (${ezjail_ftphost}) seems to provide the following builds:\n${ezjail_ftpresponse}"
166 _ret=0; break 167 _ret=0; break 2
167 fi 168 fi
168 done 169 done
169 IFS=${TIFS} 170 IFS=${TIFS}
170 return _ret 171 ezjail_ftpserverqueried="YES"
172 return ${_ret}
171} 173}
172 174
173############################# 175#############################
@@ -504,7 +506,7 @@ setup|update)
504######################## ezjail-admin INSTALL ######################## 506######################## ezjail-admin INSTALL ########################
505install) 507install)
506 # Clean variables, prevent polution 508 # Clean variables, prevent polution
507 unset ezjail_release ezjail_ftphost ezjail_installmanpages ezjail_installports ezjail_installsources ezjail_dir ezjail_reldir 509 unset ezjail_release ezjail_ftphost ezjail_installmanpages ezjail_installports ezjail_installsources ezjail_dir ezjail_reldir ezjail_ftpserverqueried
508 510
509 shift; while getopts :mpsh:r: arg; do case ${arg} in 511 shift; while getopts :mpsh:r: arg; do case ${arg} in
510 m) ezjail_installmanpages=" manpages";; 512 m) ezjail_installmanpages=" manpages";;
@@ -554,8 +556,9 @@ install)
554 # Try all paths as stolen from sysinstall, break on success. 556 # Try all paths as stolen from sysinstall, break on success.
555 for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do 557 for ezjail_path in pub/FreeBSD/releases pub/FreeBSD/snapshot pub/FreeBSD releases snapshots NO; do
556 if [ "${ezjail_path}" = "NO" ]; then 558 if [ "${ezjail_path}" = "NO" ]; then
557 echo "Could not fetch ${pkg} from ${ezjail_ftphost}. Maybe your release (${ezjail_release}) is specified incorrectly or the host ${ezjail_ftphost} does not provide that release build. Use the -r option to specify an existing release or the -h option to specify an alternative ftp server." >&2 559 echo -e "\nCould not fetch ${pkg} from ${ezjail_ftphost}.\nMaybe your release (${ezjail_release}) is specified incorrectly or the host ${ezjail_ftphost} does not provide that release build.\nUse the -r option to specify an existing release or the -h option to specify an alternative ftp server." >&2
558 ezjail_queryftpserver; exit 1 560 [ -z "${ezjail_ftpserverqueried}" ] && ezjail_queryftpserver
561 exit 1
559 fi 562 fi
560 ftp "${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/${ezjail_release}/${pkg}/*" && break 563 ftp "${ezjail_ftphost}:${ezjail_path}/${ezjail_installarch}/${ezjail_release}/${pkg}/*" && break
561 done 564 done