mirror of
https://github.com/unifi-utilities/unifios-utilities.git
synced 2024-08-30 18:32:21 +00:00
4.0 support (#608)
This commit is contained in:
parent
549af97bfb
commit
e5269cf3cf
@ -1,22 +1,19 @@
|
|||||||
#! /bin/sh
|
#! /bin/bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "$DATA_DIR/att-ipv6" ]; then
|
if [ ! -d "$DATA_DIR/att-ipv6" ]; then
|
||||||
|
@ -4,18 +4,15 @@ CONTAINER=cloudflare-ddns
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "$DATA_DIR/cloudflare-ddns" ]; then
|
if [ ! -d "$DATA_DIR/cloudflare-ddns" ]; then
|
||||||
|
@ -3,19 +3,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
## configuration variables:
|
## configuration variables:
|
||||||
VLAN=5
|
VLAN=5
|
||||||
IPV4_IP="10.0.5.3"
|
IPV4_IP="10.0.5.3"
|
||||||
|
@ -4,20 +4,16 @@ CONTAINER=haproxy
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "${DATA_DIR}/haproxy" ]; then
|
if [ ! -d "${DATA_DIR}/haproxy" ]; then
|
||||||
# If it does not exist, create the directory
|
# If it does not exist, create the directory
|
||||||
|
@ -3,20 +3,16 @@ IMAGE=haproxy:latest
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
podman pull $IMAGE
|
podman pull $IMAGE
|
||||||
podman stop haproxy
|
podman stop haproxy
|
||||||
podman rm haproxy
|
podman rm haproxy
|
||||||
|
@ -8,10 +8,7 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -5,20 +5,16 @@ CONTAINER=homebridge
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## network configuration and startup:
|
## network configuration and startup:
|
||||||
CNI_PATH=${DATA_DIR}/podman/cni
|
CNI_PATH=${DATA_DIR}/podman/cni
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
|
@ -4,20 +4,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "${DATA_DIR}/scripts" ]; then
|
if [ ! -d "${DATA_DIR}/scripts" ]; then
|
||||||
# If it does not exist, create the directory
|
# If it does not exist, create the directory
|
||||||
|
@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -3,18 +3,15 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bssh
|
||||||
|
|
||||||
## Configure shell profile
|
## Configure shell profile
|
||||||
PROFILE_SOURCE=/data/settings/profile/global.profile.d
|
PROFILE_SOURCE=/data/settings/profile/global.profile.d
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
alias ...=../..
|
alias ...=../..
|
||||||
alias ....=../../..
|
alias ....=../../..
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
PATH="/data/opt:$PATH"
|
PATH="/data/opt:$PATH"
|
||||||
export PATH
|
export PATH
|
||||||
|
@ -3,18 +3,15 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# 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
|
# make sure cni plugs are installed
|
||||||
if ! test -f /opt/cni/bin/macvlan; then
|
if ! test -f /opt/cni/bin/macvlan; then
|
||||||
echo "Error: CNI plugins not found. You can install it with the following command:" >&2
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM debian:stretch-slim
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
RUN set -ex \
|
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 update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
You can execute in UDM/Pro/SE and UDR with:
|
You can execute in UDM/Pro/SE and UDR with:
|
||||||
|
|
||||||
```bash
|
```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.
|
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
|
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
|
```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
|
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.0_all.deb
|
dpkg -i udm-boot-2x_1.0.1_all.deb
|
||||||
systemctl enable udm-boot
|
systemctl enable udm-boot
|
||||||
exit
|
exit
|
||||||
```
|
```
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# prerm script for udm-boot
|
# prerm script for udm-boot
|
||||||
#
|
#
|
||||||
# see: dh_installdeb(1)
|
# see: dh_installdeb(1)
|
||||||
|
@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
## Config Variables - please edit these
|
## Config Variables - please edit these
|
||||||
# Set to true to download public keys from a github user account
|
# Set to true to download public keys from a github user account
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
## Places public keys in ~/.ssh/authorized_keys
|
## Places public keys in ~/.ssh/authorized_keys
|
||||||
|
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
#####################################################
|
#####################################################
|
||||||
# ADD KNOWN HOSTS AS BELOW - CHANGE BEFORE RUNNING #
|
# ADD KNOWN HOSTS AS BELOW - CHANGE BEFORE RUNNING #
|
||||||
|
@ -3,18 +3,15 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
mkdir -p ${DATA_DIR}/.home
|
mkdir -p ${DATA_DIR}/.home
|
||||||
|
|
||||||
|
@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -4,20 +4,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# A change in the name udm-boot would need to be reflected as well in systemctl calls.
|
# 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"
|
SYSTEMCTL_PATH="/etc/systemd/system/udm-boot.service"
|
||||||
SYMLINK_SYSTEMCTL="/etc/systemd/system/multi-user.target.wants/udm-boot.service"
|
SYMLINK_SYSTEMCTL="/etc/systemd/system/multi-user.target.wants/udm-boot.service"
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
You can execute in UDM/Pro/SE and UDR with:
|
You can execute in UDM/Pro/SE and UDR with:
|
||||||
|
|
||||||
```bash
|
```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.
|
This is a force to install script so will uninstall any previous version and install on_boot keeping your on boot files.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# postinst script for udm-boot
|
# postinst script for udm-boot
|
||||||
#
|
#
|
||||||
# see: dh_installdeb(1)
|
# see: dh_installdeb(1)
|
||||||
|
@ -3,19 +3,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
mkdir -p ${DATA_DIR}/.home
|
mkdir -p ${DATA_DIR}/.home
|
||||||
|
|
||||||
for file in .ash_history .bash_history; do
|
for file in .ash_history .bash_history; do
|
||||||
|
@ -1,26 +1,19 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
4*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# A change in the name udm-boot would need to be reflected as well in systemctl calls.
|
# 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"
|
SYSTEMCTL_PATH="/etc/systemd/system/udm-boot.service"
|
||||||
SYMLINK_SYSTEMCTL="/etc/systemd/system/multi-user.target.wants/udm-boot.service"
|
SYMLINK_SYSTEMCTL="/etc/systemd/system/multi-user.target.wants/udm-boot.service"
|
||||||
|
@ -3,19 +3,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "${DATA_DIR}/scripts" ]; then
|
if [ ! -d "${DATA_DIR}/scripts" ]; then
|
||||||
|
@ -45,18 +45,15 @@ esac
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CACHE_DIR="${DATA_DIR}/podman/cache"
|
CACHE_DIR="${DATA_DIR}/podman/cache"
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
|
@ -4,18 +4,15 @@ CONTAINER=rclone
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
|
@ -29,5 +29,5 @@
|
|||||||
1. Login to run rclone commands locally to create and test configs
|
1. Login to run rclone commands locally to create and test configs
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
podman exec -ti rclone /bin/sh
|
podman exec -ti rclone /
|
||||||
```
|
```
|
||||||
|
@ -6,5 +6,5 @@ RUN curl -fsSLo /opt/dote https://github.com/chrisstaite/DoTe/releases/latest/do
|
|||||||
chmod +x /opt/dote && \
|
chmod +x /opt/dote && \
|
||||||
usermod -aG pihole www-data; \
|
usermod -aG pihole www-data; \
|
||||||
mkdir -p /etc/cont-init.d && \
|
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
|
chmod +x /etc/cont-init.d/10-dote.sh
|
||||||
|
@ -7,10 +7,7 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -3,20 +3,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "${DATA_DIR}/suricata-rules" ]; then
|
if [ ! -d "${DATA_DIR}/suricata-rules" ]; then
|
||||||
# If it does not exist, create the directory
|
# If it does not exist, create the directory
|
||||||
|
@ -15,7 +15,7 @@ start() {
|
|||||||
tailscale/tailscale \
|
tailscale/tailscale \
|
||||||
tailscaled --state=mem:
|
tailscaled --state=mem:
|
||||||
# Changing sysctls inside the container to support running an exit node
|
# 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/ipv4/ip_forward ;
|
||||||
echo '1' > /proc/sys/net/ipv6/conf/all/forwarding ;
|
echo '1' > /proc/sys/net/ipv6/conf/all/forwarding ;
|
||||||
INIT
|
INIT
|
||||||
|
@ -3,20 +3,16 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "${DATA_DIR}/unbound" ]; then
|
if [ ! -d "${DATA_DIR}/unbound" ]; then
|
||||||
# If it does not exist, create the directory
|
# If it does not exist, create the directory
|
||||||
@ -60,7 +56,7 @@ CONTAINER=unbound
|
|||||||
|
|
||||||
if ! test -f /opt/cni/bin/macvlan; then
|
if ! test -f /opt/cni/bin/macvlan; then
|
||||||
echo "Error: CNI plugins not found. You can install it with the following command:" >&2
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -5,10 +5,7 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -16,7 +13,6 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# init unbound container - quick and dirty for now
|
# init unbound container - quick and dirty for now
|
||||||
# no checks, no balances
|
# no checks, no balances
|
||||||
|
|
||||||
|
@ -11,6 +11,9 @@ case "$(ubnt-device-info firmware || true)" in
|
|||||||
3*)
|
3*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
|
4*)
|
||||||
|
DATA_DIR="/data"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -4,18 +4,15 @@
|
|||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
case "$(ubnt-device-info firmware || true)" in
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
|
@ -1,22 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Get DataDir location
|
# Get DataDir location
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"case "$(ubnt-device-info firmware || true)" in
|
||||||
case "$(ubnt-device-info firmware || true)" in
|
|
||||||
1*)
|
1*)
|
||||||
DATA_DIR="/mnt/data"
|
DATA_DIR="/mnt/data"
|
||||||
;;
|
;;
|
||||||
2*)
|
2* | 3* | 4*)
|
||||||
DATA_DIR="/data"
|
DATA_DIR="/data"
|
||||||
;;
|
;;
|
||||||
3*)
|
|
||||||
DATA_DIR="/data"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "ERROR: No persistent storage found." 1>&2
|
echo "ERROR: No persistent storage found." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the directory exists
|
# Check if the directory exists
|
||||||
if [ ! -d "${DATA_DIR}/zerotier-one" ]; then
|
if [ ! -d "${DATA_DIR}/zerotier-one" ]; then
|
||||||
# If it does not exist, create the directory
|
# If it does not exist, create the directory
|
||||||
|
Loading…
Reference in New Issue
Block a user