mirror of
https://codeberg.org/polyteknisk-radiogruppe/the_prg_server_configuration.git
synced 2026-06-13 18:28:55 +02:00
Fixed the curl invocation typo.
This commit is contained in:
parent
87d80bcf42
commit
59eb7ee53c
1 changed files with 7 additions and 7 deletions
|
|
@ -610,7 +610,7 @@ in {
|
||||||
|
|
||||||
# Try all the ip services for a valid IPv4 address
|
# Try all the ip services for a valid IPv4 address
|
||||||
for service in $${IP_SERVICES[@]}; do
|
for service in $${IP_SERVICES[@]}; do
|
||||||
RAW_IP=$(${pkgs.curl} -s $service)
|
RAW_IP=$(${pkgs.curl}/bin/curl -s $service)
|
||||||
if [[ $RAW_IP =~ $REGEX_IPV4 ]]; then
|
if [[ $RAW_IP =~ $REGEX_IPV4 ]]; then
|
||||||
CURRENT_IP=$BASH_REMATCH
|
CURRENT_IP=$BASH_REMATCH
|
||||||
logger -s "DDNS Updater: Fetched IP $CURRENT_IP"
|
logger -s "DDNS Updater: Fetched IP $CURRENT_IP"
|
||||||
|
|
@ -640,7 +640,7 @@ in {
|
||||||
###########################################
|
###########################################
|
||||||
|
|
||||||
logger "DDNS Updater: Check Initiated"
|
logger "DDNS Updater: Check Initiated"
|
||||||
record=$(${pkgs.curl} -s -X GET "https://api.cloudflare.com/client/v4/zones/$${zone_identifier}/dns_records?type=A&name=$${record_name}" \
|
record=$(${pkgs.curl}/bin/curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$${zone_identifier}/dns_records?type=A&name=$${record_name}" \
|
||||||
-H "X-Auth-Email: $${auth_email}" \
|
-H "X-Auth-Email: $${auth_email}" \
|
||||||
-H "$${auth_header} $${auth_key}" \
|
-H "$${auth_header} $${auth_key}" \
|
||||||
-H "Content-Type: application/json")
|
-H "Content-Type: application/json")
|
||||||
|
|
@ -671,7 +671,7 @@ in {
|
||||||
###########################################
|
###########################################
|
||||||
## Change the IP@Cloudflare using the API
|
## Change the IP@Cloudflare using the API
|
||||||
###########################################
|
###########################################
|
||||||
update=$(${pkgs.curl} -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$${zone_identifier}/dns_records/$${record_identifier}" \
|
update=$(${pkgs.curl}/bin/curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$${zone_identifier}/dns_records/$${record_identifier}" \
|
||||||
-H "X-Auth-Email: $${auth_email}" \
|
-H "X-Auth-Email: $${auth_email}" \
|
||||||
-H "$${auth_header} $${auth_key}" \
|
-H "$${auth_header} $${auth_key}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
|
|
@ -685,21 +685,21 @@ in {
|
||||||
echo -e "DDNS Updater: $${CURRENT_IP} $${record_name} DDNS failed for $${record_identifier} ($${CURRENT_IP}). DUMPING RESULTS:\n$update" | logger -s
|
echo -e "DDNS Updater: $${CURRENT_IP} $${record_name} DDNS failed for $${record_identifier} ($${CURRENT_IP}). DUMPING RESULTS:\n$update" | logger -s
|
||||||
if [[ -n "$${slackuri}" ]]; then
|
if [[ -n "$${slackuri}" ]]; then
|
||||||
msg="$${sitename} DDNS Update Failed: $${record_name}: $${record_identifier} ($${CURRENT_IP})."
|
msg="$${sitename} DDNS Update Failed: $${record_name}: $${record_identifier} ($${CURRENT_IP})."
|
||||||
${pkgs.curl} -L -X POST "$${slackuri}" --data-raw "{\"channel\":\"$${slackchannel}\",\"text\":\"$${msg}\"}"
|
${pkgs.curl}/bin/curl -L -X POST "$${slackuri}" --data-raw "{\"channel\":\"$${slackchannel}\",\"text\":\"$${msg}\"}"
|
||||||
fi
|
fi
|
||||||
if [[ -n "$${discorduri}" ]]; then
|
if [[ -n "$${discorduri}" ]]; then
|
||||||
msg="$${sitename} DDNS Update Failed: $${record_name}: $${record_identifier} ($${CURRENT_IP})."
|
msg="$${sitename} DDNS Update Failed: $${record_name}: $${record_identifier} ($${CURRENT_IP})."
|
||||||
${pkgs.curl} -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-raw "{\"content\":\"$${msg}\"}" "$${discorduri}"
|
${pkgs.curl}/bin/curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-raw "{\"content\":\"$${msg}\"}" "$${discorduri}"
|
||||||
fi
|
fi
|
||||||
exit 1;;
|
exit 1;;
|
||||||
*)
|
*)
|
||||||
msg="$${sitename} Updated: $${record_name}'s new IP Address is $${CURRENT_IP}"
|
msg="$${sitename} Updated: $${record_name}'s new IP Address is $${CURRENT_IP}"
|
||||||
logger "DDNS Updater: $${CURRENT_IP} $${record_name} DDNS updated."
|
logger "DDNS Updater: $${CURRENT_IP} $${record_name} DDNS updated."
|
||||||
if [[ -n "$${slackuri}" ]]; then
|
if [[ -n "$${slackuri}" ]]; then
|
||||||
${pkgs.curl} -L -X POST "$${slackuri}" --data-raw "{\"channel\":\"$${slackchannel}\",\"text\":\"$${msg}\"}"
|
${pkgs.curl}/bin/curl -L -X POST "$${slackuri}" --data-raw "{\"channel\":\"$${slackchannel}\",\"text\":\"$${msg}\"}"
|
||||||
fi
|
fi
|
||||||
if [[ -n "$${discorduri}" ]]; then
|
if [[ -n "$${discorduri}" ]]; then
|
||||||
${pkgs.curl} -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-raw "{\"content\":\"$${msg}\"}" "$${discorduri}"
|
${pkgs.curl}/bin/curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-raw "{\"content\":\"$${msg}\"}" "$${discorduri}"
|
||||||
fi
|
fi
|
||||||
exit 0;;
|
exit 0;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue