add share-link password/expiry, journal touch-ups, ddns helper and audit docs
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# dynv6 DDNS update script
|
||||
# Environment variables expected:
|
||||
# DYNDNS_TOKEN - dynv6 token
|
||||
# DYNDNS_HOSTNAME - domain name (e.g., kiberone.dns.army)
|
||||
|
||||
set -e
|
||||
|
||||
TOKEN="${DYNDNS_TOKEN}"
|
||||
HOSTNAME="${DYNDNS_HOSTNAME}"
|
||||
|
||||
if [ -z "$TOKEN" ] || [ -z "$HOSTNAME" ]; then
|
||||
echo "ERROR: DYNDNS_TOKEN and DYNDNS_HOSTNAME must be set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[$(date)] Updating dynv6 for $HOSTNAME..."
|
||||
|
||||
# Update IPv4
|
||||
IPV4=$(curl -s -4 https://api.ipify.org 2>/dev/null || echo "")
|
||||
if [ -n "$IPV4" ]; then
|
||||
echo "[$(date)] Detected IPv4: $IPV4"
|
||||
RESPONSE=$(curl -s "https://dynv6.com/api/update?hostname=${HOSTNAME}&token=${TOKEN}&ipv4=${IPV4}")
|
||||
echo "[$(date)] IPv4 update response: $RESPONSE"
|
||||
else
|
||||
echo "[$(date)] No IPv4 detected"
|
||||
fi
|
||||
|
||||
# Update IPv6
|
||||
IPV6=$(curl -s -6 https://api6.ipify.org 2>/dev/null || echo "")
|
||||
if [ -n "$IPV6" ]; then
|
||||
echo "[$(date)] Detected IPv6: $IPV6"
|
||||
RESPONSE=$(curl -s "https://dynv6.com/api/update?hostname=${HOSTNAME}&token=${TOKEN}&ipv6=${IPV6}")
|
||||
echo "[$(date)] IPv6 update response: $RESPONSE"
|
||||
else
|
||||
echo "[$(date)] No IPv6 detected"
|
||||
fi
|
||||
|
||||
echo "[$(date)] Update complete"
|
||||
Reference in New Issue
Block a user