diff --git a/Dockerfile b/Dockerfile index ca947b9..3b5fa9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,6 @@ RUN \ echo "**** install packages ****" && \ apt-get update && \ apt-get install --no-install-recommends -y \ - bash \ - curl \ gnupg \ jsvc \ libcap2 \ diff --git a/README.md b/README.md index 0bf3b86..d34ad55 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **01.03.23:** - Migrate to s6v3 * **12.01.22:** - Switch to MongoDB 4.4 * **29.09.21:** - Documentation updates * **13.08.21:** - Initial Release diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config deleted file mode 100644 index da9da22..0000000 --- a/root/etc/cont-init.d/50-config +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/with-contenv bash - -#Symlinks -symlinks=( \ -/app/omada/data \ -/app/omada/properties \ -) - -shopt -s globstar dotglob - -for i in "${symlinks[@]}"; do -[[ -d /config/"$(basename "$i")" && ! -L "$i" ]] && rm -rf "$i" -[[ ! -d /config/"$(basename "$i")" && ! -L "$i" ]] && mv "$i" /config/ -[[ -d /config/"$(basename "$i")" && ! -L "$i" ]] && ln -s /config/"$(basename "$i")" "$i" -done - -symlinks=( \ -/app/omada/logs \ -/app/omada/work \ -) - -for i in "${symlinks[@]}"; do -[[ -d /config/"$(basename "$i")" && ! -L "$i" ]] && rm -rf "$i" -[[ ! -d /config/"$(basename "$i")" && ! -L "$i" ]] && mkdir -p /config/"$(basename "$i")" -[[ -d /config/"$(basename "$i")" && ! -L "$i" ]] && ln -s /config/"$(basename "$i")" "$i" -done - -shopt -u globstar dotglob - -mkdir -p /app/omada/data/autobackup - -#Permissions -chown -R abc:abc \ - /config \ - /app \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-adduser/branding b/root/etc/s6-overlay/s6-rc.d/init-adduser/branding new file mode 100644 index 0000000..8e610af --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-adduser/branding @@ -0,0 +1,15 @@ +─────────────────────────────────────── + + ██╗ ███████╗██╗ ██████╗ + ██║ ██╔════╝██║██╔═══██╗ + ██║ ███████╗██║██║ ██║ + ██║ ╚════██║██║██║ ██║ + ███████╗███████║██║╚██████╔╝ + ╚══════╝╚══════╝╚═╝ ╚═════╝ + + █ █▀▀▄ █▀▀▄ █▀▀ + █ █▄▄█ █▀▀▄ ▀▀▄ + ▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀ + + Brought to you by linuxserver.io +─────────────────────────────────────── diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-omada-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-omada-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-omada-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-omada-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-omada-config/run b/root/etc/s6-overlay/s6-rc.d/init-omada-config/run new file mode 100755 index 0000000..43a5b42 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-omada-config/run @@ -0,0 +1,48 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +#Symlinks +symlinks=( \ +/app/omada/data \ +/app/omada/properties \ +) + +shopt -s globstar dotglob + +for i in "${symlinks[@]}"; do + if [[ -d /config/"$(basename "$i")" && ! -L "$i" ]]; then + rm -rf "$i" + fi + if [[ ! -d /config/"$(basename "$i")" && ! -L "$i" ]]; then + mv "$i" /config/ + fi + if [[ -d /config/"$(basename "$i")" && ! -L "$i" ]]; then + ln -s /config/"$(basename "$i")" "$i" + fi +done + +symlinks=( \ +/app/omada/logs \ +/app/omada/work \ +) + +for i in "${symlinks[@]}"; do + if [[ -d /config/"$(basename "$i")" && ! -L "$i" ]]; then + rm -rf "$i" + fi + if [[ ! -d /config/"$(basename "$i")" && ! -L "$i" ]]; then + mkdir -p /config/"$(basename "$i")" + fi + if [[ -d /config/"$(basename "$i")" && ! -L "$i" ]]; then + ln -s /config/"$(basename "$i")" "$i" + fi +done + +shopt -u globstar dotglob + +mkdir -p /app/omada/data/autobackup + +#Permissions +lsiown -R abc:abc \ + /config \ + /app diff --git a/root/etc/s6-overlay/s6-rc.d/init-omada-config/type b/root/etc/s6-overlay/s6-rc.d/init-omada-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-omada-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-omada-config/up b/root/etc/s6-overlay/s6-rc.d/init-omada-config/up new file mode 100644 index 0000000..b38cd82 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-omada-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-omada-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-omada/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-omada/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/omada/run b/root/etc/s6-overlay/s6-rc.d/svc-omada/run old mode 100644 new mode 100755 similarity index 92% rename from root/etc/services.d/omada/run rename to root/etc/s6-overlay/s6-rc.d/svc-omada/run index 6c3919b..38b6872 --- a/root/etc/services.d/omada/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-omada/run @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash case $(uname -m) in x86_64) @@ -34,4 +35,4 @@ exec \ -XX:HeapDumpPath=${LOG_DIR}/java_heapdump.hprof \ -Djava.awt.headless=true \ -Dlog4j2.formatMsgNoLookups=true \ - com.tplink.smb.omada.starter.OmadaLinuxMain \ No newline at end of file + com.tplink.smb.omada.starter.OmadaLinuxMain diff --git a/root/etc/s6-overlay/s6-rc.d/svc-omada/type b/root/etc/s6-overlay/s6-rc.d/svc-omada/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-omada/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-omada-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-omada-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-omada b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-omada new file mode 100644 index 0000000..e69de29