-[ -z "$http_proxy" ] && export http_proxy=http://`mdw-conf http-proxy`/
-[ -z "$ftp_proxy" ] && export ftp_proxy=$http_proxy
+
+http=`mdw-conf http-proxy none`
+case "${http_proxy-none},$http" in
+ *,none) ;;
+ none,*) export http_proxy=http://$http/ ;;
+esac
+ftp=`mdw-conf ftp-proxy none`
+case "${ftp_proxy-none},$ftp,${http_proxy-none}" in
+ *,none,none) ;;
+ none,none,*) export ftp_proxy=$http_proxy ;;
+ none,*,*) export ftp_proxy=http://$ftp/ ;;
+esac