minor improvement in fspget, now checking that the uri begins with fsp://
This commit is contained in:
parent
052bae42dc
commit
0f2bbac0f0
34
setup.sh
34
setup.sh
|
|
@ -55,19 +55,27 @@ alias fcd='set -f;_fcd'
|
||||||
|
|
||||||
####something like wget emulation####
|
####something like wget emulation####
|
||||||
_fspget() {
|
_fspget() {
|
||||||
FSP_HOST=$(echo $1|awk -F"/" '{print $3}'|awk -F":" '{print $1}')
|
usage="echo \"Usage: fsp://[host]:[port]/path/to/file\""
|
||||||
FSP_DIR=$(dirname $(echo $1|sed -e 's/fsp:\/\/.*:[0-9]*\//\//g'))
|
|
||||||
|
|
||||||
fsp_port=$(echo $1|awk -F"/" '{print $3}'|awk -F":" '{print $2}')
|
|
||||||
if [ -n $fsp_port ]
|
|
||||||
then
|
|
||||||
FSP_PORT=$fsp_port
|
|
||||||
fi
|
|
||||||
filename=$(basename $(echo $1|sed -e 's/fsp:\/\/.*:[0-9]*\//\//g'))
|
|
||||||
|
|
||||||
echo "Retrieving $filename from $FSP_HOST with FSPd running on port $FSP_PORT"
|
case $1 in
|
||||||
fver
|
fsp://*)
|
||||||
fget $filename
|
FSP_HOST=$(echo $1|awk -F"/" '{print $3}'|awk -F":" '{print $1}')
|
||||||
echo "DONE"
|
FSP_DIR=$(dirname $(echo $1|sed -e 's/fsp:\/\/.*:[0-9]*\//\//g'))
|
||||||
|
|
||||||
|
fsp_port=$(echo $1|awk -F"/" '{print $3}'|awk -F":" '{print $2}')
|
||||||
|
if [ -n $fsp_port ]
|
||||||
|
then
|
||||||
|
FSP_PORT=$fsp_port
|
||||||
|
fi
|
||||||
|
filename=$(basename $(echo $1|sed -e 's/fsp:\/\/.*:[0-9]*\//\//g'))
|
||||||
|
|
||||||
|
echo "Retrieving $filename from $FSP_HOST with FSPd running on port $FSP_PORT"
|
||||||
|
fver
|
||||||
|
fget $filename
|
||||||
|
echo "DONE"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
eval $usage
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
alias fspget='set -f;_fspget'
|
alias fspget='set -f;_fspget'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user