mirror of
https://github.com/danog/gigaclone.git
synced 2024-11-26 20:14:58 +01:00
44 lines
922 B
Bash
44 lines
922 B
Bash
#!/bin/bash
|
|
set -e
|
|
n=0
|
|
y=1
|
|
|
|
until [ "$n" = "1000" ];do {
|
|
y="$y
|
|
1"
|
|
n="$(($n + 1))"
|
|
};done
|
|
dir="$PWD"
|
|
tmp="$dir/tmp"
|
|
copy="$dir/copy"
|
|
mkdir $tmp $tmp/usr
|
|
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
|
|
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' $f
|
|
echo "Remove duplicates for $f"
|
|
awk '!seen[$0]++' $f>$tmp/1
|
|
echo "Download urls in $f."
|
|
wget -i $tmp/1 -x -N -P $dir >/dev/null
|
|
};done
|
|
|
|
cd $dir
|
|
mv profile.gigaset.net $copy
|
|
|
|
fdupes -dr $copy <<< "$y"
|
|
|
|
wget https://copy.com/install/linux/Copy.tgz
|
|
tar xvzf Copy.tgz
|
|
cd copy/x86_64
|
|
./CopyConsole -u=$user -r=$copy -p=$pass
|