What's new

Add No-IP ipadres to whitelist in Ipset_Block

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

topmusic

Occasional Visitor
Hello Everyone,

Im looking for a script that will whitelist my ip from my phone (use no-ip on it) to get to my mailserver at home.
I am allot on the road these days and most of the time my phone's ip-address is blocked by IPSET_Block.sh script.
So is there a way that the script will do the following.
- Read my onroad ip-address from no-ip and parse it to the whitelist on my router
- Reload the network for the ip to get unbanned and whitelisted
- Logging in on my mailserver.

I have created a new no-ip ddns which i use on my phone.
My router is an RT-AC87U with entware on it, running Asuswrt-Merlin Firmware:380.69_2

Any help is appreciated.
Thx
 
Oke i have it running from a few code-snippets.

This is what i have so far, the code on the bottom #check_ip is missing something, because when i activate it it does nothing :(

<code>
#!/bin/sh
VER="v1.00a"
#============ © 2018 v1.00a
#
# Use this to update your ip-adres for the ipset firewall
#
# 1 user ddns.hopto.org added 13-04-18
#

log_file="/tmp/mnt/RT-AC87U/wimip.log"
SCRIPT_PATH="/jffs/scripts/IPSET_Block.sh"
now=$(date +%d-%m-%Y/%H:%M)

IP=$(dig +short ddns.hopto.org @resolver1.opendns.com)
echo "[$now]=[$IP]" >> ${log_file}

#function checkip()
#{
#if [[ $(/usr/sbin/ipset list Whitelist |grep -c "$IP") = 0 ]]; then
# echo "ERROR - $IP is NOT in Whitelist"
(exec "$SCRIPT_PATH" unban $IP whitelist)
# fi
#if [ "$IP" -eq "1" ]; then
# echo "NEW $IP is already in the whitelist]"
# echo "[$now]=[$IP]" >> ${log_file}
# /usr/sbin/ipset list Whitelist > /jffs/configs/IPSET_Whitelist.org #create backup
# fi
#}
</code>
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top