This script checks your version against the newest version on SourceForge and checks your architecture.
Link to script (in case it is updated after this post): https://github.com/DirtyCajunRice/scrip ... ebotupdate
Actual script:
Code: Select all
#!/bin/bash
baseurl='https://sourceforge.net/projects/filebot/files/filebot/'
currentver=$(filebot -version | awk '{print $2}')
currentsimple=$(sed 's/\.//g' <<< "$currentver")
newestver=$(curl -s $baseurl | grep -w "<a href\=\"/projects/filebot/files/filebot/*" |\
cut -f6 -d'/' | awk ' NR==2{print $1}' | cut -f2 -d'_' | sed 's/\.//g')
newestsimple=$(sed 's/\.//g' <<< "$newestver")
architecture=$(uname -m)
if [ "$architecture" = "x86_64" ]; then
arch='amd64'
elif [ "$architecture" = "i386" ] || [ "$architecture" = "i686" ]; then
arch='i386'
elif [[ "$architecture" == *"arm"* ]]; then
arch='armhf'
else
echo "You are running on $architecture architecture"
echo "This is not supported. Exiting"
exit
fi
echo "You are currently on FileBot version $currentver"
if [ "$currentsimple" -lt "$newestsimple" ]; then
cd /tmp || echo "Cannot change to tmp dir. Exiting" && exit
echo "You are out of date!"
echo "Downloading version $newestver"
wget -q "${baseurl}FileBot_${newestver}/filebot_${newestver}_${arch}.deb"
echo "Removing current version"
dpkg -r filebot
echo "Installing new version"
dpkg -i /tmp/filebot*.deb
echo "Cleaning up"
rm /tmp/filebot*.deb
else
echo "You are on the newest version. Exiting"
fi