summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-10-31 09:59:20 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-10-31 09:59:20 +0100
commit50f8bb0c4dd45f727974f9e81666c59bb8148939 (patch)
tree0b713d5b370e9ba17fbedf96b151218c21220ecf /src
parent95aaac4b515fcedbddce8311c42f7da77b640117 (diff)
http support for downloading a profile
Diffstat (limited to 'src')
-rwxr-xr-xsrc/fifa.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fifa.sh b/src/fifa.sh
index 7d3f13e..ceaac75 100755
--- a/src/fifa.sh
+++ b/src/fifa.sh
@@ -42,9 +42,14 @@ die_error ()
load_profile()
{
[ -z "$1" ] && die_error "load_profile needs a profile argument"
- #TODO: http support
echo "Loading profile $1 ..."
- profile=/home/arch/fifa/profile-$1
+ if [[ $1 =~ ^http:// ]]
+ then
+ profile=/home/arch/fifa/profile-downloaded-`basename $1`
+ wget $1 -q -O $profile >/dev/null || die_error "Could not download profile $1"
+ else
+ profile=/home/arch/fifa/profile-$1
+ fi
[ -f "$profile" ] && source "$profile" || die_error "Something went wrong while sourcing profile $profile"
}