4.0 support (#608)

This commit is contained in:
John Dorman 2024-05-13 19:34:28 -07:00 committed by GitHub
parent 549af97bfb
commit e5269cf3cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 229 additions and 334 deletions

View File

@ -1,22 +1,19 @@
#! /bin/sh
#! /bin/bash
set -eo pipefail
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "$DATA_DIR/att-ipv6" ]; then

View File

@ -4,18 +4,15 @@ CONTAINER=cloudflare-ddns
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "$DATA_DIR/cloudflare-ddns" ]; then

View File

@ -3,19 +3,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
## configuration variables:
VLAN=5
IPV4_IP="10.0.5.3"

View File

@ -4,20 +4,16 @@ CONTAINER=haproxy
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "${DATA_DIR}/haproxy" ]; then
# If it does not exist, create the directory

View File

@ -3,20 +3,16 @@ IMAGE=haproxy:latest
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
podman pull $IMAGE
podman stop haproxy
podman rm haproxy

View File

@ -8,10 +8,7 @@ case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)

View File

@ -5,20 +5,16 @@ CONTAINER=homebridge
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
## network configuration and startup:
CNI_PATH=${DATA_DIR}/podman/cni
# Check if the directory exists

View File

@ -4,20 +4,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "${DATA_DIR}/scripts" ]; then
# If it does not exist, create the directory

View File

@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)

View File

@ -3,18 +3,15 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bssh
## Configure shell profile
PROFILE_SOURCE=/data/settings/profile/global.profile.d

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
alias ...=../..
alias ....=../../..

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
PATH="/data/opt:$PATH"
export PATH

View File

@ -3,18 +3,15 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
@ -36,7 +33,7 @@ CONTAINER_CNI_PATH="${DATA_DIR}/podman/cni/45-mosquitto.conflist"
# make sure cni plugs are installed
if ! test -f /opt/cni/bin/macvlan; then
echo "Error: CNI plugins not found. You can install it with the following command:" >&2
echo " curl -fsSLo ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/main/cni-plugins/05-install-cni-plugins.sh && /bin/sh ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh" >&2
echo " curl -fsSLo ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/main/cni-plugins/05-install-cni-plugins.sh && /bin/bash ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh" >&2
exit 1
fi

View File

@ -1,7 +1,7 @@
FROM debian:stretch-slim
FROM debian:bookworm-slim
RUN set -ex \
&& echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list \
&& echo 'deb http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/backports.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \

View File

@ -22,7 +22,7 @@
You can execute in UDM/Pro/SE and UDR with:
```bash
curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script-2.x/remote_install.sh" | /bin/sh
curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script-2.x/remote_install.sh" | /bin/bash
```
This is a force to install script so will uninstall any previous version and install on_boot keeping your on boot files.
@ -37,11 +37,11 @@ This will also install CNI Plugins & CNI Bridge scripts. If you are using UDMSE/
unifi-os shell
```
2. Download [udm-boot-2x_1.0.1_all.deb](packages/udm-boot_1.0.0-2x_all.deb) and install it and go back to the UDM.
2. Download [udm-boot-2x_1.0.1_all.deb](packages/udm-boot-2x_1.0.1_all.deb) and install it and go back to the UDM.
```bash
curl -L [[https://udm-boot.boostchicken.dev](https://unifi.boostchicken.io/udm-boot-2x_1.0.0_all.deb)](https://unifi.boostchicken.io/udm-boot-2x_1.0.0_all.deb) -o udm-boot-2x_1.0.0_all.deb
dpkg -i udm-boot-2x_1.0.0_all.deb
curl -L [[https://unifi.boostchicken.io/udm-boot-v2+/udm-boot-2x_1.0.1_all.deb](https://unifi.boostchicken.io/udm-boot-v2+/udm-boot-2x_1.0.1_all.deb)](https://unifi.boostchicken.io/udm-boot-v2+/udm-boot-2x_1.0.1_all.deb) -o udm-boot-2x_1.0.1_all.deb
dpkg -i udm-boot-2x_1.0.1_all.deb
systemctl enable udm-boot
exit
```

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# prerm script for udm-boot
#
# see: dh_installdeb(1)

View File

@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)

View File

@ -1,21 +1,17 @@
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
## Config Variables - please edit these
# Set to true to download public keys from a github user account

View File

@ -1,20 +1,16 @@
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
## Places public keys in ~/.ssh/authorized_keys

View File

@ -1,20 +1,16 @@
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
#####################################################
# ADD KNOWN HOSTS AS BELOW - CHANGE BEFORE RUNNING #

View File

@ -3,18 +3,15 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
mkdir -p ${DATA_DIR}/.home

View File

@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)

View File

@ -4,20 +4,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# A change in the name udm-boot would need to be reflected as well in systemctl calls.
SYSTEMCTL_PATH="/etc/systemd/system/udm-boot.service"
SYMLINK_SYSTEMCTL="/etc/systemd/system/multi-user.target.wants/udm-boot.service"

View File

@ -34,7 +34,7 @@
You can execute in UDM/Pro/SE and UDR with:
```bash
curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script/remote_install.sh" | /bin/sh
curl -fsL "https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/HEAD/on-boot-script/remote_install.sh" | /bin/bash
```
This is a force to install script so will uninstall any previous version and install on_boot keeping your on boot files.

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# postinst script for udm-boot
#
# see: dh_installdeb(1)

View File

@ -3,19 +3,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
mkdir -p ${DATA_DIR}/.home
for file in .ash_history .bash_history; do

View File

@ -1,26 +1,19 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
4*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# A change in the name udm-boot would need to be reflected as well in systemctl calls.
SYSTEMCTL_PATH="/etc/systemd/system/udm-boot.service"
SYMLINK_SYSTEMCTL="/etc/systemd/system/multi-user.target.wants/udm-boot.service"

View File

@ -3,19 +3,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "${DATA_DIR}/scripts" ]; then

View File

@ -45,18 +45,15 @@ esac
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
CACHE_DIR="${DATA_DIR}/podman/cache"

View File

@ -1,20 +1,16 @@
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists

View File

@ -4,18 +4,15 @@ CONTAINER=rclone
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists

View File

@ -29,5 +29,5 @@
1. Login to run rclone commands locally to create and test configs
```sh
podman exec -ti rclone /bin/sh
podman exec -ti rclone /
```

View File

@ -6,5 +6,5 @@ RUN curl -fsSLo /opt/dote https://github.com/chrisstaite/DoTe/releases/latest/do
chmod +x /opt/dote && \
usermod -aG pihole www-data; \
mkdir -p /etc/cont-init.d && \
echo -e "#!/bin/sh\nchmod +x /opt/dote\n/opt/dote \$DOTE_OPTS -d\n" > /etc/cont-init.d/10-dote.sh && \
echo -e "#!/bin/bash\nchmod +x /opt/dote\n/opt/dote \$DOTE_OPTS -d\n" > /etc/cont-init.d/10-dote.sh && \
chmod +x /etc/cont-init.d/10-dote.sh

View File

@ -7,10 +7,7 @@ case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)

View File

@ -3,20 +3,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "${DATA_DIR}/suricata-rules" ]; then
# If it does not exist, create the directory

View File

@ -15,7 +15,7 @@ start() {
tailscale/tailscale \
tailscaled --state=mem:
# Changing sysctls inside the container to support running an exit node
cat <<'INIT' | podman exec --privileged ${CONTAINER} /bin/sh
cat <<'INIT' | podman exec --privileged ${CONTAINER} /bin/bash
echo '1' > /proc/sys/net/ipv4/ip_forward ;
echo '1' > /proc/sys/net/ipv6/conf/all/forwarding ;
INIT

View File

@ -3,20 +3,16 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "${DATA_DIR}/unbound" ]; then
# If it does not exist, create the directory
@ -60,7 +56,7 @@ CONTAINER=unbound
if ! test -f /opt/cni/bin/macvlan; then
echo "Error: CNI plugins not found. You can install it with the following command:" >&2
echo " curl -fsSLo ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/main/cni-plugins/05-install-cni-plugins.sh && /bin/sh ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh" >&2
echo " curl -fsSLo ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh https://raw.githubusercontent.com/unifi-utilities/unifios-utilities/main/cni-plugins/05-install-cni-plugins.sh && /bin/bash ${DATA_DIR}/on_boot.d/05-install-cni-plugins.sh" >&2
exit 1
fi

View File

@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
@ -16,7 +13,6 @@ case "$(ubnt-device-info firmware || true)" in
exit 1
;;
esac
# init unbound container - quick and dirty for now
# no checks, no balances

View File

@ -11,6 +11,9 @@ case "$(ubnt-device-info firmware || true)" in
3*)
DATA_DIR="/data"
;;
4*)
    DATA_DIR="/data"
    ;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1

View File

@ -4,18 +4,15 @@
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists

View File

@ -1,22 +1,17 @@
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
DATA_DIR="/mnt/data"
;;
2* | 3* | 4*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
# Check if the directory exists
if [ ! -d "${DATA_DIR}/zerotier-one" ]; then
# If it does not exist, create the directory