forked from Clarifai/coreos-nvidia
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck.sh
More file actions
executable file
·26 lines (23 loc) · 745 Bytes
/
check.sh
File metadata and controls
executable file
·26 lines (23 loc) · 745 Bytes
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
#!/bin/bash
#
# Check for NVIDIA driver updates
#
DRIVER=${1:-367.27}
TRACKS="${2:-alpha beta stable}"
for track in ${TRACKS}
do
# Can't use $(< because it prints errors for a missing file!
last=$(cat last.${track} 2>/dev/null)
# Grab the most recent directory
curl -s https://${track}.release.core-os.net/amd64-usr/ |
grep -oE '<a href="[0-9.]+/">' | grep -o '[0-9\.]*' |
sort -n | tail -1 | while read v; do
# Use sort -V version comparison
if [ "${last}" != "$(/bin/echo -e ${v}\\n${last} | sort -rV | head -1)" ]
then
# We rely on the previous sorting to build the most recent version last
bash -x ./build.sh ${DRIVER} ${track} ${v} && echo ${v} > last.${track}
fi
done
done
exit