فهرست منبع

don't upgrade if already on the latest platform (unless -f), fixes #9

Dave Eddy 10 سال پیش
والد
کامیت
16c6d76bcd
1فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 13 0
      platform-upgrade

+ 13 - 0
platform-upgrade

@@ -8,6 +8,19 @@ platform_dir="platform-$version"
 platform_url="$host$latest_path/$platform_file"
 md5sums_url="$host$latest_path/md5sums.txt"
 
+force=false
+while getopts 'f' option; do
+	case "$option" in
+		f) force=true;;
+	esac
+done
+
+IFS=_ read brand kernel < <(uname -v)
+if [[ $kernel == $version ]]; then
+	echo "already on latest version: $kernel"
+	$force || exit -1
+fi
+
 tmp=$(mktemp -d)
 cd "$tmp" || exit -1