Linux Articles, Shell Scripts February 24, 2008 0

My wget – niech ściąga

  • A small tuning of wget – sometimes a remote servers are braking up the connection. This wget will try and try until download complete or user will cancel an action.

#!/bin/sh
#script file: my_wget.sh

if [ $1 -z ]; then
        echo ""
    echo "[usage:] my_wget.sh <address url>"
        echo ""
        exit 1
else
    while true; do wget -c $1
        if [ $? -eq 0 ]; then
            echo "Download status: OK"; break
                else continue
        fi
    done
fi

#END-SCRIPT#