diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-10-31 09:59:20 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-10-31 09:59:20 +0100 |
commit | 50f8bb0c4dd45f727974f9e81666c59bb8148939 (patch) | |
tree | 0b713d5b370e9ba17fbedf96b151218c21220ecf | |
parent | 95aaac4b515fcedbddce8311c42f7da77b640117 (diff) |
http support for downloading a profile
-rwxr-xr-x | src/fifa.sh | 9 |
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" } |