This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# checkv6cfd.sh | |
# Copyright (c) 2021, Francis Turner | |
# All rights reserved. | |
# | |
# Script that automates checking and if required downloading and replacing of the | |
# latest armv6 cloudflared as built by Darren Hobin (https://github.com/hobindar) | |
# for use on pi zeros and other armv6 devices | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -L https://golang.org/dl/$(curl -s https://api.github.com/repos/golang/go/git/matching-refs/tags/go | grep '/ref' | sed -e '/beta/ d' -e '/rc/ d' -e 's/.*\(go[0-9.]*\).*/\1/' | tail -1).linux-armv6l.tar.gz | sudo tar -xzC /usr/local | |
# change armv6l for arm64 to get the 64 bit version for pi 4s | |
#set up etc. | |
echo 'PATH=$PATH:/usr/local/go/bin' >> ~/.profile | |
source ~/.profile | |
which go | |
go version | |
#optionally | |
# echo 'GOPATH=/home/pi/golang' >> ~/.profile | |
# mkdir /home/pi/golang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -e 's/^/"/' -e 's/$/",/' -e '1 s/^/[/' -e '$ s/,$/]/' file.txt > file.json |