-
Notifications
You must be signed in to change notification settings - Fork 38
/
package.sh
executable file
·21 lines (18 loc) · 964 Bytes
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -e
SOURCE="${1?You must provide the repo root as the first argument}"
DEST="${2?You must provide the destination directory as the second argument}"
WORKDIR="$(mktemp -d || exit 1)"
trap 'rm -rf ${WORKDIR}' EXIT
echo "Preparing temporary build directory"
mkdir -p "${WORKDIR}/tailscale" "${WORKDIR}/on_boot.d"
cp "${SOURCE}/package/on-boot.sh" "${WORKDIR}/on_boot.d/10-tailscaled.sh"
cp "${SOURCE}/package/manage.sh" "${WORKDIR}/tailscale/manage.sh"
cp "${SOURCE}/package/unios_"*".sh" "${WORKDIR}/tailscale/"
cp "${SOURCE}/package/tailscale-env" "${WORKDIR}/tailscale/tailscale-env"
cp "${SOURCE}/package/tailscale-install.service" "${WORKDIR}/tailscale/tailscale-install.service"
cp "${SOURCE}/LICENSE" "${WORKDIR}/tailscale/LICENSE"
echo "Building tailscale-udm package"
mkdir -p "${DEST}"
# Assuming GNU tar with the --owner and --group args
tar czf "${DEST}/tailscale-udm.tgz" -C "${WORKDIR}" tailscale on_boot.d --owner=0 --group=0