File cronjob.sh of Package youtube-dl

#!/bin/bash
current=$(curl http://youtube-dl.org/latest/version 2>/dev/null)
return=$?
[ ${return} -gt 0 ] && exit 0

[ -f ./.version ] && last=$(<./.version);

[ ${current} == ${last} ] && exit 0

echo $current > ./.version 
echo  -n "Triggering rebuild for youtube-dl-${current}..."
osc -A pm up

rm youtube-dl-201*tar.gz*

wget -P . http://yt-dl.org/downloads/latest/youtube-dl-${current}.tar.gz
wget -P . http://yt-dl.org/downloads/latest/youtube-dl-${current}.tar.gz.sig

sed -i s,"Version:.*","Version:\t ${current}",g youtube-dl.spec python-youtube-dl.spec

osc -A pm addremove
for i in *.changes; do osc -A pm vc -m "Updated to version ${current}" $i; done
osc -A pm ci -m "Updated to version ${current}"