1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

if version_gt $CURRENT_KERN $OLD_RPI_KERN ; then

This commit is contained in:
A Holt 2017-11-08 02:53:54 -05:00 committed by GitHub
parent c63f4f671f
commit 50cf4c44ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,25 +10,27 @@ CWD=`pwd`
OS=`grep ^ID= /etc/*release|cut -d= -f2` OS=`grep ^ID= /etc/*release|cut -d= -f2`
OS=${OS//\"/} OS=${OS//\"/}
function version_gt() { [ "$(printf '%s\n' "$@" | sort -V | head -1)" != "$1" ]; }
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
if [ ! -f $PLAYBOOK ]; then if [ ! -f $PLAYBOOK ]; then
echo "IIAB Playbook not found." echo "IIAB Playbook not found."
echo "Please run this command from /opt/iiab/iiab (top level of the git repo)." echo "Please run this command from the top level of the git repo."
echo "Exiting." echo "Exiting."
exit 1 exit 1
fi fi
if [ $OS == "raspbian" ]; then if [ $OS == "raspbian" ]; then
echo "Found Raspbian" echo "Found Raspbian"
ABORT=`uname -a | grep $OLD_RPI_KERN | wc -l` CURRENT_KERN=`uname -r`
if [ "$ABORT" == 1 ]; then if version_gt $CURRENT_KERN $OLD_RPI_KERN ; then
echo "Kernel "$OLD_RPI_KERN" is obsolete. Before running './iiab-install' you first need" echo "Kernel looks ok - continuing"
echo "to update your system with 'apt update' then 'apt dist-upgrade' then reboot." else
echo "Kernel "$OLD_RPI_KERN" is obsolete. Before running './iiab-install' you first"
echo "need to update your system with 'apt update' then 'apt dist-upgrade' then reboot."
echo "INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation" echo "INSTALL INSTRUCTIONS: https://github.com/iiab/iiab/wiki/IIAB-Installation"
exit 1 exit 1
else
echo "Kernel looks ok - continuing"
fi fi
fi fi
@ -58,8 +60,8 @@ else
elif [ $STAGE == 9 ]; then elif [ $STAGE == 9 ]; then
# place keeper add read response # place keeper add read response
# "offer 'Y' or stage number dialog box option to override" # "offer 'Y' or stage number dialog box option to override"
echo "'iiab-install' has already been completed." echo "'iiab-install' has already been completed"
echo "Use --debug to override." echo "use --debug to override "
#echo "In demo mode not preventing second run" #echo "In demo mode not preventing second run"
echo "Exiting." echo "Exiting."
exit 1 exit 1