diff --git a/ct/authentik.sh b/ct/authentik.sh index d2654433d..a90cf4885 100644 --- a/ct/authentik.sh +++ b/ct/authentik.sh @@ -213,20 +213,8 @@ start build_container msg_info "Attaching data storage volume" -$STD pct stop "$CTID" -if [ "${PROTECT_CT:-}" == "1" ] || [ "${PROTECT_CT:-}" == "yes" ]; then - $STD pct set "$CTID" --protection 0 - $STD pct set "$CTID" -mp0 "${CONTAINER_STORAGE}":1,mp=/opt/authentik-data,backup=1 - $STD pct set "$CTID" --protection 1 -else - $STD pct set "$CTID" -mp0 "${CONTAINER_STORAGE}":1,mp=/opt/authentik-data,backup=1 -fi -$STD pct start "$CTID" -for i in {1..10}; do - pct status "$CTID" | grep -q "status: running" && break - sleep 1 -done -$STD pct exec "$CTID" -- bash -c "mkdir -p /opt/authentik-data/{certs,media,geoip,templates}; \ +ct_attach_volume 1 /opt/authentik-data +$STD ct_exec bash -c "mkdir -p /opt/authentik-data/{certs,media,geoip,templates}; \ cp /opt/authentik/tests/geoip/GeoLite2-ASN-Test.mmdb /opt/authentik-data/geoip/GeoLite2-ASN.mmdb; \ cp /opt/authentik/tests/geoip/GeoLite2-City-Test.mmdb /opt/authentik-data/geoip/GeoLite2-City.mmdb; \ cp -r /opt/authentik/blueprints /opt/authentik-data/; \ @@ -235,7 +223,7 @@ $STD pct exec "$CTID" -- bash -c "mkdir -p /opt/authentik-data/{certs,media,geoi msg_ok "Attached data storage volume" msg_info "Starting Services" -pct exec "$CTID" -- systemctl enable -q --now authentik-server authentik-worker +ct_exec systemctl enable -q --now authentik-server authentik-worker msg_ok "Started Services" description diff --git a/ct/dietpi.sh b/ct/dietpi.sh index f78183316..1f1d08037 100755 --- a/ct/dietpi.sh +++ b/ct/dietpi.sh @@ -44,11 +44,7 @@ build_container description msg_info "Restarting ${APP} for DietPi's first boot" -if command -v pct &>/dev/null; then - pct reboot "$CTID" -else - incus restart "$CTID" -fi +ct_restart msg_ok "Restarted ${APP}" msg_ok "Completed successfully!" diff --git a/ct/orb.sh b/ct/orb.sh index ad2ab2de2..1b474a871 100644 --- a/ct/orb.sh +++ b/ct/orb.sh @@ -45,4 +45,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${TAB}${GATEWAY}${BGN}To link the sensor to your orb account run:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}pct exec ${CTID} -- runuser -u orb -- orb link${CL}" +echo -e "${TAB}${GATEWAY}${BGN}$(ct_exec_hint runuser -u orb -- orb link)${CL}"