corcoran
New Around Here
Hi folks,
I've got a wan-event script that pushes to pushover, but it won't execute a curl to get my 'real ip' - am I missing something? The script runs OK on reboot, just don't get the output. If I put the environment variable wan_fake_ip, that prints OK; but can't get it to push wan_from_curl nor wan_real_ip into the script.
I've got a wan-event script that pushes to pushover, but it won't execute a curl to get my 'real ip' - am I missing something? The script runs OK on reboot, just don't get the output. If I put the environment variable wan_fake_ip, that prints OK; but can't get it to push wan_from_curl nor wan_real_ip into the script.
#!/bin/sh
export wan_from_curl="$(curl -fs4 http://ipconfig.io/)"
export wan_real_ip="$(nvram get wan0_realip_ip)"
export wan_fake_ip="85.63.35.192"
asusadmin@RT-AX88U-8FD0:/jffs/scripts# cat wan-event
#!/bin/sh
. /jffs/scripts/pushover_creds.sh
. /jffs/scripts/get_wan.sh
push_message(){
echo "Pushover Init"
curl -s \
--form-string "token=$pushover_token"\
--form-string "user=$pushover_user"\
--form-string "message=WAN Reconnect Successful at $wan_real_ip"\
https://api.pushover.net/1/messages.json
}
if [ "$2" = "connected" ]; then
push_message
else
echo $wan_real_ip
fi