2015-09-27 11:00:08 +02:00
#!/bin/bash
2015-09-29 11:30:18 +02:00
2015-09-27 11:44:47 +02:00
dir="$PWD"
2015-09-29 11:30:18 +02:00
set -e
2015-09-27 11:44:47 +02:00
git config --global user.name "${GIT_NAME}"
git config --global user.email "${GIT_EMAIL}"
git config --global push.default simple
2015-09-27 11:00:08 +02:00
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"
2015-10-08 19:32:22 +02:00
sed -i '/200\|206\|302\|301/!d;s/\sHTTP.*//g;s/.*\s/http:\/\/profile\.gigaset\.net/g;/http:\/\/profile\.gigaset\.net\"\"/d;s/?.*//g;s/\.net\/device/\.net\/chagall/g;s/^\.$//g' $f
2015-09-27 11:00:08 +02:00
echo "Remove duplicates for $f"
awk '!seen[$0]++' $f>>$tmp/tmp
};done
echo "Remove all duplicates"
awk '!seen[$0]++' $tmp/tmp $dir/urllist >$tmp/final
2015-09-30 13:55:18 +02:00
echo "Remove useless stuff..."
2015-10-08 19:32:22 +02:00
sed -i '/200\|206\|302\|301/!d;s/\sHTTP.*//g;s/.*\s/http:\/\/profile\.gigaset\.net/g;/http:\/\/profile\.gigaset\.net\"\"/d;s/?.*//g;s/\.net\/device/\.net\/chagall/g;s/^\.$//g' $tmp/final
2015-09-30 13:55:18 +02:00
echo "Remove all duplicates"
awk '!seen[$0]++' $tmp/final >$tmp/finall
mv $tmp/finall $dir/urllist
2015-09-27 11:00:08 +02:00
2015-09-27 11:19:33 +02:00
git clone https://${GH_TOKEN}@github.com/danog/gigaclone.git $tmp/git
2015-09-27 11:00:08 +02:00
cd $tmp/git
cp $dir/urllist .
git add -A
2015-09-29 11:10:18 +02:00
2015-09-27 11:00:08 +02:00
git commit -m "Updated url list"
git push origin master &>/dev/null
cd $dir
echo "Clean up."
2015-09-27 11:44:47 +02:00
rm -fr $tmp
2015-09-29 19:49:18 +02:00