1
0
mirror of https://github.com/danog/gigaclone.git synced 2025-01-23 06:01:14 +01:00
gigaclone/gigaclone
2015-09-26 19:40:54 +02:00

39 lines
1.1 KiB
Bash

#!/bin/bash
set -e
[ "$1" = "--help" ] && echo "Script to clone the profile.gigaset.net firmware website.
This website contains all of the provisioning data and the firmwares for Siemens Gigaset devices.
Usage: $(basename $0) output_dir
If no output dir is specified, . is the default.
"
[ "$1" = "" ] && dir="$PWD" || dir="$1"
tmp="$dir/tmp"
mkdir $tmp
cd $tmp
wget http://profile.gigaset.net/logs.tgz && tar -xzf logs.tgz
cd log
for f in ./*;do {
echo "Working... for $f"
sed -i '/.*404.*/d;/.*403.*/d;s/\sHTTP.*//g;s/.*\s/http:\/\/profile\.gigaset\.net/g;/http:\/\/profile\.gigaset\.net\"\"/d;s/?.*//g;s/\.net\/device/\.net\/chagall/g' $f
echo "Remove duplicates for $f"
awk '!seen[$0]++' $f>>$tmp/tmp
};done
echo "Remove all duplicates"
awk '!seen[$0]++' $tmp/tmp >$tmp/final
cd $dir
echo "Download everything."
[ "$TRAVIS" = "true" ] && travis_wait wget -i $tmp/final -x -N 2>/dev/null || wget -i $tmp/1 -x -N
echo "Clean up."
rm -r $tmp
[ "$TRAVIS" = "true" ] {
copy="$dir/copy"
mkdir $copy
mv profile.gigaset.net $copy
wget https://copy.com/install/linux/Copy.tgz
tar xvzf Copy.tgz
cd copy/x86_64
./CopyConsole -u=$user -r=$copy -p=$pass
}