Initial commit
Basic working code that is capable of establishing the Wireguard tunnel given that there is properly configured `.psk` file for at least one known wifi network (see README.md for more details)
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# First argument is preprocessed .env file supposed to be in tmp.build.XXXXXXXXXX directory
|
||||
# Let's load it up
|
||||
. $1
|
||||
|
||||
alpine_source() {
|
||||
find ${CACHE_DIR} -type f -name ${RELEASE_BASENAME}.tar.gz | grep -q ${RELEASE_BASENAME} || \
|
||||
curl -sSL ${ALPINE_MIRROR}/${RELEASE_VERSION}/releases/${ALPINE_ARCH}/${RELEASE_BASENAME}.tar.gz -o ${CACHE_DIR}/${RELEASE_BASENAME}.tar.gz
|
||||
|
||||
mkdir -p ${CACHE_DIR}/${RELEASE_BASENAME}
|
||||
|
||||
find ${CACHE_DIR}/${RELEASE_BASENAME} -type d -empty -exec tar xfz ${CACHE_DIR}/${RELEASE_BASENAME}.tar.gz -C ${CACHE_DIR}/${RELEASE_BASENAME} \;
|
||||
}
|
||||
|
||||
tailspin_bin() {
|
||||
find ${CACHE_DIR} -type f -name tailspin.tar.gz | grep -q tailspin || \
|
||||
curl -sSL https://github.com/bensadeh/tailspin/releases/download/4.0.0/tailspin-x86_64-unknown-linux-musl.tar.gz -o ${CACHE_DIR}/tailspin.tar.gz
|
||||
|
||||
mkdir -p ${CACHE_DIR}/tailspin
|
||||
|
||||
find ${CACHE_DIR}/tailspin -type d -empty -exec tar xfz ${CACHE_DIR}/tailspin.tar.gz -C ${CACHE_DIR}/tailspin \;
|
||||
}
|
||||
|
||||
age_bin() {
|
||||
find ${CACHE_DIR} -type d -name age-src | grep -q age-src || \
|
||||
git clone https://github.com/wj/age.git ${CACHE_DIR}/age-src
|
||||
|
||||
mkdir -p ${CACHE_DIR}/age
|
||||
|
||||
find ${CACHE_DIR}/age -type d -empty -exec docker run --rm -v ${CACHE_DIR}/age:/usr/local/bin -e GOBIN=/usr/local/bin/ -v ${CACHE_DIR}/age-src:/usr/src/age -w /usr/src/age golang:1.22-alpine go install ./cmd/age \;
|
||||
}
|
||||
|
||||
mkdir -p secrets
|
||||
mkdir -p ${CACHE_DIR}/aport
|
||||
mkdir -p ${CACHE_DIR}/extras
|
||||
|
||||
# Second argument is supposed to be name of the functions decalred above
|
||||
# Let's call it
|
||||
$2
|
||||
Reference in New Issue
Block a user