Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A small script to automatically download the latest Maemo-Leste image from maedevu.maemo.org/images/n900
#!/bin/sh
DOWNLOAD_DIR="$HOME/Downloads"
if test -d $DOWNLOAD_DIR ; then
echo "Using specified download directory: $DOWNLOAD_DIR"
else
echo "Specified download directory doesn't exist: $DOWNLOAD_DIR"
exit
fi
newest=$(curl -s 'http://maedevu.maemo.org/images/n900/' | grep -Eo '[0-9]{8}' | uniq | tail -1)
filename="maemo-leste-1.0-armhf-n900-$newest.img.xz"
download_filepath=$DOWNLOAD_DIR/$filename
download_url="http://maedevu.maemo.org/images/n900/$newest/$filename"
#echo $url
if test -s $download_filepath ; then
echo "File exists: $download_filepath"
exit
else
echo "File doesn't exist, downloading $download_url"
wget $download_url -O $download_filepath
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.