mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-14 07:33:34 +01:00
A simple question on dns txt variable #410
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Tungsteno74 on GitHub (Jun 9, 2019).
Hello @lukas2511 ,
I can't find at which dehydrated code the
$4variablie in the duckdns hook.sh refers.This is the piece of code:
It is supposed to be a TXT with record APIs from duckDNS page, but which ones exactly?
I ask this because I'm trying to implement another Hook based on this.
Thanks in advance
@jobe1986 commented on GitHub (Jun 9, 2019):
It should be noted that when comparing the linked duckDNS hook script to the example hook script https://github.com/lukas2511/dehydrated/blob/master/docs/examples/hook.sh that the $ variables are offset by one. That is where the duckDNS hook script says $4, read that as $3 in the example hook script. So in this case, $4 is the token value and thus the content of the TXT record.
@Tungsteno74 commented on GitHub (Jun 9, 2019):
thanks @jobe1986 ,
ok well, now i understand better why how works, but why is it shifted?
Practically, the following slice of code from dehydrated hook.sh example is wrong:
I tested it and DOMAIN variable give me "deploy_challenge" value. As you proposed if i "shift" it by one it returns me the correct value.
Is this a normal behavior or i miss something?
thanks
@lukas2511 commented on GitHub (Jun 10, 2019):
The example hook shifts the variables before calling the functions (see last few lines of that example script). So yea, problem seems to be that you copied stuff around without adjusting for the differences in the scripts.
Edit: Reason for the shift is purely to make a clear difference between the functions and the data given for each.