summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-23 16:53:59 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-23 16:53:59 +0100
commit97201eb01b101754fdd9f638e06282e57f6aea07 (patch)
tree0382b25d8cb668e9df1d8c603bb6db0a856ddc90
parent83614da41a5eb643a0bceeb23293be4460af797e (diff)
downloadalpine-conf-97201eb01b101754fdd9f638e06282e57f6aea07.zip
setup-proxy: use ask instead of default_read and add debug stuff
add -p for setting ROOT so we can debug this easier.
-rw-r--r--setup-proxy.in13
1 files changed, 8 insertions, 5 deletions
diff --git a/setup-proxy.in b/setup-proxy.in
index 1b1b008..e75aff4 100644
--- a/setup-proxy.in
+++ b/setup-proxy.in
@@ -1,8 +1,9 @@
#!/bin/sh
PREFIX=
-. "$PREFIX/lib/libalpine.sh"
-
+for i in ./libalpine.sh $PREFIX/lib/libalpine.sh; do
+ [ -e $i ] && . $i && break
+done
usage() {
cat <<__EOF__
@@ -21,10 +22,11 @@ __EOF__
-while getopts "hq" opt; do
+while getopts "hp:q" opt; do
case "$opt" in
q) quiet=1;;
h) usage;;
+ p) ROOT=$OPTARG;;
esac
done
@@ -44,13 +46,14 @@ while true; do
http://*) break;;
none) proxyurl= ; break;;
esac
- echon "HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [$suggest] "
- default_read proxyurl $suggest
+ ask "HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none')" $suggest
+ proxyurl=$resp
done
if [ -z "$proxyurl" ]; then
rm -f "$PROFILE"
else
+ mkdir -p "${PROFILE%/*}"
cat >"$PROFILE" <<__EOF__
# this file was generated with and might get overwritten by setup-proxy