mirror of
https://github.com/danog/gigaclone.git
synced 2024-11-30 04:29:09 +01:00
Update gigaclone
This commit is contained in:
parent
c5e56f18ae
commit
3080d7b5a3
45
gigaclone
45
gigaclone
@ -1,43 +1,38 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
n=0
|
[ "$1" = "--help" ] && echo "Script to clone the profile.gigaset.net firmware website.
|
||||||
y=1
|
This website contains all of the provisioning data and the firmwares for Siemens Gigaset devices.
|
||||||
t() { until [ "$(ps aux | grep wget | grep -v grep)" = "" ]; do echo Still Downloading;sleep 8m;done; }
|
Usage: $(basename $0) output_dir
|
||||||
until [ "$n" = "1000" ];do {
|
|
||||||
y="$y
|
If no output dir is specified, . is the default.
|
||||||
1"
|
"
|
||||||
n="$(($n + 1))"
|
[ "$1" = "" ] && dir="$PWD" || dir="$1"
|
||||||
};done
|
|
||||||
dir="$PWD"
|
|
||||||
tmp="$dir/tmp"
|
tmp="$dir/tmp"
|
||||||
copy="$dir/copy"
|
mkdir $tmp
|
||||||
mkdir $tmp $tmp/usr $copy
|
|
||||||
cd $tmp
|
|
||||||
git clone https://github.com/adrianlopezroche/fdupes
|
|
||||||
cd fdupes
|
|
||||||
sed -i 's%PREFIX = \/usr\/local%PREFIX = '$tmp'\/usr%g' Makefile
|
|
||||||
make fdupes
|
|
||||||
make install
|
|
||||||
export PATH="$PATH:$tmp/usr/bin"
|
|
||||||
cd $tmp
|
cd $tmp
|
||||||
wget http://profile.gigaset.net/logs.tgz && tar -xzf logs.tgz
|
wget http://profile.gigaset.net/logs.tgz && tar -xzf logs.tgz
|
||||||
|
|
||||||
cd log
|
cd log
|
||||||
for f in ./*;do {
|
for f in ./*;do {
|
||||||
echo "Working... for $f"
|
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
|
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"
|
echo "Remove duplicates for $f"
|
||||||
awk '!seen[$0]++' $f>$tmp/1
|
awk '!seen[$0]++' $f>>$tmp/tmp
|
||||||
echo "Download urls in $f."
|
|
||||||
wget -i $tmp/1 -x -N -P $dir 2>&1 | t
|
|
||||||
};done
|
};done
|
||||||
|
echo "Remove all duplicates"
|
||||||
|
awk '!seen[$0]++' $tmp/tmp >$tmp/final
|
||||||
|
|
||||||
cd $dir
|
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
|
mv profile.gigaset.net $copy
|
||||||
|
|
||||||
#fdupes -dr $copy <<< "$y"
|
|
||||||
|
|
||||||
wget https://copy.com/install/linux/Copy.tgz
|
wget https://copy.com/install/linux/Copy.tgz
|
||||||
tar xvzf Copy.tgz
|
tar xvzf Copy.tgz
|
||||||
cd copy/x86_64
|
cd copy/x86_64
|
||||||
./CopyConsole -u=$user -r=$copy -p=$pass
|
./CopyConsole -u=$user -r=$copy -p=$pass
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user