Skip to content

Commit

Permalink
4.0 support (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
boostchicken authored May 14, 2024
1 parent 549af97 commit e5269cf
Show file tree
Hide file tree
Showing 42 changed files with 229 additions and 334 deletions.
21 changes: 9 additions & 12 deletions att-ipv6/10-att-ipv6.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 8 additions & 11 deletions cloudflare-ddns/on_boot.d/30-cloudflare-ddns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 9 additions & 12 deletions dns-common/on_boot.d/10-dns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 8 additions & 12 deletions haproxy/50-haproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 8 additions & 12 deletions haproxy/update-haproxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions hdhomerun/on_boot.d/99-hdhomerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
*)
Expand Down
22 changes: 9 additions & 13 deletions homebridge/on_boot.d/25-homebridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 8 additions & 12 deletions ipt-enable-logs/on_boot.d/30-ipt-enable-logs-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions ipt-enable-logs/scripts/ipt-enable-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
*)
Expand Down
19 changes: 8 additions & 11 deletions ipt-enable-logs/scripts/refresh-iptables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modern-unix/on_boot.d/10-shell-profile.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bssh

This comment has been minimized.

Copy link
@fdcastel

fdcastel May 14, 2024

@boostchicken Is this correct?


## Configure shell profile
PROFILE_SOURCE=/data/settings/profile/global.profile.d
Expand Down
2 changes: 1 addition & 1 deletion modern-unix/settings/profile/global.profile.d/aliases.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

alias ...=../..
alias ....=../../..
Expand Down
2 changes: 1 addition & 1 deletion modern-unix/settings/profile/global.profile.d/opt.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH="/data/opt:$PATH"
export PATH
21 changes: 9 additions & 12 deletions mosquitto/on_boot.d/45-mosquitto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions on-boot-script-2.x/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions on-boot-script-2.x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion on-boot-script-2.x/dpkg-build-files/debian/prerm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# prerm script for udm-boot
#
# see: dh_installdeb(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
*)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit e5269cf

Please sign in to comment.