2023-06-07 15:45:38 +02:00
#!/bin/bash
if [ -z " $NEXTCLOUD_HOST " ] ; then
2024-10-18 17:50:31 +02:00
echo "NEXTCLOUD_HOST needs to be provided. Exiting!"
2023-06-07 15:45:38 +02:00
exit 1
fi
# Only start container if nextcloud is accessible
2023-09-27 21:27:24 +02:00
while ! nc -z " $NEXTCLOUD_HOST " 9001; do
2023-06-07 15:45:38 +02:00
echo "Waiting for Nextcloud to start..."
sleep 5
done
# Correctly set CPU_ARCH for notify_push
CPU_ARCH = " $( uname -m) "
export CPU_ARCH
if [ -z " $CPU_ARCH " ] ; then
echo "Could not get processor architecture. Exiting."
exit 1
elif [ " $CPU_ARCH " != "x86_64" ] ; then
export CPU_ARCH = "aarch64"
fi
2023-09-22 12:38:46 +02:00
# Add warning
2026-01-15 17:37:54 +01:00
if ! [ -f /var/www/html/custom_apps/notify_push/bin/" $CPU_ARCH " /notify_push ] ; then
2023-09-22 12:38:46 +02:00
echo "The notify_push binary was not found."
echo "Most likely is DNS resolution not working correctly."
echo "You can try to fix this by configuring a DNS server globally in dockers daemon.json."
echo "See https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html"
echo "Afterwards a restart of docker should automatically resolve this."
echo "Additionally, make sure to disable VPN software that might be running on your server"
echo "Also check your firewall if it blocks connections to github"
echo "If it should still not work afterwards, feel free to create a new thread at https://github.com/nextcloud/all-in-one/discussions/new?category=questions and post the Nextcloud container logs there."
echo ""
echo ""
exit 1
fi
2023-11-30 12:40:19 +01:00
echo "notify-push was started"
2023-06-07 15:45:38 +02:00
# Run it
2026-01-15 17:37:54 +01:00
/var/www/html/custom_apps/notify_push/bin/" $CPU_ARCH " /notify_push \
--port 7867 \
/var/www/html/config/config.php
2023-06-07 15:45:38 +02:00
exec " $@ "