Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Previous examples are good ideas. Here is another variant. This one checks that the actual repository is available.

source <(grep VERSION_ID /etc/os-release) let releasever=$(expr $VERSION_ID + 1) basearch=$(uname -i) source <(grep baseurl <(grep -A10 '[fedora]' /etc/yum.repos.d/fedora.repo)|sed -e 's/^#//' -e 's/=/="/' -e 's/$/"/') if curl --output /dev/null --silent --head --fail "$baseurl"; then echo "THERE IS A NEW VERSION!!!" else echo "No new version has yet been released." fi

Previous examples are good ideas. Here is another variant. This one checks that the actual repository is available.

source <(grep VERSION_ID /etc/os-release)
let releasever=$(expr $VERSION_ID + 1)
basearch=$(uname -i)
source <(grep baseurl <(grep -A10 '[fedora]' '\[fedora\]' /etc/yum.repos.d/fedora.repo)|sed -e 's/^#//' -e 's/=/="/' -e 's/$/"/')
if curl --output /dev/null --silent --head --fail "$baseurl"; then
    echo "THERE IS A NEW VERSION!!!"
else
        echo "No new version has yet been released."
fi

fi

Previous examples are good ideas. Here is another variant. This one checks that the actual repository is available.

#!/bin/bash
source <(grep VERSION_ID /etc/os-release)
let releasever=$(expr $VERSION_ID + 1)
basearch=$(uname -i)
source <(grep baseurl <(grep -A10 '\[fedora\]' /etc/yum.repos.d/fedora.repo)|sed -e 's/^#//' -e 's/=/="/' -e 's/$/"/')
if curl --output /dev/null --silent --head --fail "$baseurl"; then
    echo "THERE IS A NEW VERSION!!!"
else
     echo "No new version has yet been released."
fi