summaryrefslogtreecommitdiff
path: root/bin/stella_compatibilityChecker
blob: 7aaf1cd03a3a8aea3afac23f802945e2a6e47787 (plain)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 
#!/usr/bin/env bash # compatibilityChecker - Stella project OEM platform compatibility checker # Copyright (C) 2013 Penk Chen <penk.chen@canonical.com> # # Usage: compatibilityChecker [ -r ] [ -p ] # -r print release status: Release Version | Development Version | Unsupported Hardware # -p print platform name wget http://10.101.47.249/stella-hw/getID.sh wget http://10.101.47.249/stella-hw/platform-compatibility-list mv getID.sh platform-compatibility-list /tmp . /tmp/platform-compatibility-list . /tmp/getID.sh usage() { echo "Usage: $0 [ -r ] [ -p ]	-r	print release status: Release Version | Development Version | Unsupported Hardware	-p	print platform name	-s	print system ID " 1>&2; exit 1; } OPTION="release" while getopts ":rsp" o; do	case "${o}" in	r) OPTION="release";	;;	p) echo ${platformLookupTable[$ID]} | cut -d':' -f1;	exit;	;;	s) echo $ID;	exit;	;;	*) usage	;;	esac done shift $((OPTIND-1)) OUTPUT=`echo ${platformLookupTable[$ID]} | cut -d':' -f1` if [ $OPTION == "release" ]; then if [ ! -z $OUTPUT ]; then # Got the system ID, checking for GM date GMDate=`echo ${platformLookupTable[$ID]} | cut -d':' -f2` if [ ! -z $GMDate ]; then GMDateEpoch=`date --date=$GMDate +%s` OneWeekBeforeGMDateEpoch=`date --date="$GMDate -7 day" +%s` BuildDate=`tail -n1 /etc/buildstamp | rev | cut -d'-' -f2 | rev` BuildDateEpoch=`date --date=$BuildDate +%s` if [ $BuildDateEpoch -gt $OneWeekBeforeGMDateEpoch ]; then OUTPUT="Release Version" else OUTPUT="Development Version" # not reaching GM yet fi else OUTPUT="Development Version" # GM date not available fi else OUTPUT="Unsupported Hardware" fi fi zenity --info --text="$OUTPUT" #echo $OUTPUT