diff options
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/functions-ftp.sh')
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend/functions-ftp.sh | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-ftp.sh b/usr.sbin/pc-sysinstall/backend/functions-ftp.sh index 3bf95a8..db230f3 100755 --- a/usr.sbin/pc-sysinstall/backend/functions-ftp.sh +++ b/usr.sbin/pc-sysinstall/backend/functions-ftp.sh @@ -280,20 +280,43 @@ show_mirrors() set_ftp_mirror() { - MIRROR="${1}" - echo "${MIRROR}" > "${CONFDIR}/mirrors.conf" + MIRROR="${1}" + echo "${MIRROR}" > "${CONFDIR}/mirrors.conf" }; get_ftp_mirror() { - MIRROR="${DEFAULT_FTP_SERVER}" - if [ -f "${CONFDIR}/mirrors.conf" ] - then - MIRROR=`cat "${CONFDIR}/mirrors.conf"` - fi - - VAL="${MIRROR}" - export VAL + MIRROR="${DEFAULT_FTP_SERVER}" + if [ -f "${CONFDIR}/mirrors.conf" ] + then + MIRROR=`cat "${CONFDIR}/mirrors.conf"` + fi + + VAL="${MIRROR}" + export VAL +}; + + +get_ftpHost() +{ + get_value_from_cfg ftpPath + ftpPath="$VAL" + + ftpHost=`echo "${ftpPath}" | sed -E 's|^(ftp://)([^/]*)(.*)|\2|'` + VAL="${ftpHost}" + + export VAL +}; + +get_ftpDir() +{ + get_value_from_cfg ftpPath + ftpPath="$VAL" + + ftpDir=`echo "${ftpPath}" | sed -E 's|^(ftp://)([^/]*)(.*)|\3|'` + VAL="${ftpDir}" + + export VAL }; get_ftp_mirrors() |