You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
604 B
Fish

# Defined in /tmp/fish.xZCDu4/bw-check.fish @ line 2
function bw-check
set root /home/anton/projects/bavaria-wifi
set fname all.min-(date +%Y-%m-%d-%H-%M-%S).js
set js (curl -s https://hotspot.vodafone.de/bayern/dist/js/all.min.js)
set sha (echo -n "$js" | sha1sum | string split " ")[1]
if ! cat $root/shasums | grep $sha
echo "$js" > $root/scripts/$fname
echo -e "Found new script! sha: $sha.\nSaved in $root/scripts/$fname"
echo "$sha" (date +%Y-%m-%d-%H-%M-%S) >> $root/shasums
else
echo "nothing new"
end
end