mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-08 00:41:14 -04:00
make params required, disable service if not configured conrrectly
This commit is contained in:
@@ -70,10 +70,11 @@ else
|
||||
fi
|
||||
cloudflared -v
|
||||
|
||||
echo "**** Checking for optional cloudflare tunnel parameters... ****"
|
||||
if [[ ${#CF_ACCOUNT_ID} -gt 0 ]] && [[ ${#CF_API_TOKEN} -gt 0 ]] && [[ ${#CF_TUNNEL_NAME} -gt 0 ]]; then
|
||||
echo "**** Checking for cloudflare tunnel parameters... ****"
|
||||
if [[ ${#CF_ZONE_ID} -gt 0 ]] && [[ ${#CF_ACCOUNT_ID} -gt 0 ]] && [[ ${#CF_API_TOKEN} -gt 0 ]] && [[ ${#CF_TUNNEL_NAME} -gt 0 ]] && [[ ${#CF_TUNNEL_CONFIG} -gt 0 ]]; then
|
||||
if [[ ${#CF_TUNNEL_PASSWORD} -le 32 ]]; then
|
||||
echo "**** Cloudflare tunnel password must be at least 32 characters long, exiting... ****"
|
||||
rm -rf /etc/services.d/cloudflared
|
||||
exit 1
|
||||
else
|
||||
echo "**** Cloudflare tunnel parameters found, starting cloudflare tunnel setup... ****"
|
||||
@@ -162,24 +163,8 @@ if [[ ${#CF_ACCOUNT_ID} -gt 0 ]] && [[ ${#CF_API_TOKEN} -gt 0 ]] && [[ ${#CF_TUN
|
||||
done
|
||||
fi
|
||||
else
|
||||
echo "**** Optional parameters blank or missing, skipped cloudflare tunnel setup ****"
|
||||
echo "**** Cloudflare parameters blank or missing, skipped cloudflare tunnel setup ****"
|
||||
rm -rf /etc/services.d/cloudflared
|
||||
fi
|
||||
|
||||
echo "**** Cleaning up cloudflared setup script dependencies if required... ****"
|
||||
for PKG in "${!CLEANUP[@]}"; do
|
||||
if [ "${CLEANUP[$PKG]}" = true ]; then
|
||||
CLEANUP[$PKG]=false
|
||||
echo "**** Uninstalling ${PKG}... ****"
|
||||
if $ALPINE; then
|
||||
apk del ${PKG}
|
||||
elif $UBUNTU; then
|
||||
apt-get -qqy remove ${PKG}
|
||||
apt-get -qqy autoremove
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "**** Uninstalling /tmp/yq... ****"
|
||||
rm /tmp/yq
|
||||
|
||||
echo "**** Cloudflared setup script done, exiting... ****"
|
||||
Reference in New Issue
Block a user