Upgrade Complete - 4/12/2018.

External Links Open In New Tab

External Links Should Be Strictly On Shrink Link Or Link Shrink Any Who Fails To Shorten The Topic/Links Will Be Deleted

Conformation Mail Error Solved

Short Links Are Available On Every Page
For Short Links QR just add .qr at the end of short link
Eg -
http://links.darkdroid.tech/xyz
To
http://links.darkdroid.tech/xyz.qr

Upgraded To Newer Servers

May Find Errors - If Any Please Report Them HERE

New Advertisement Methods
Now You Can Be On Our Every Page!
Advertise With Us

Upgrade Complete - 05/06/2018.

Whats New ?

Google Login Method Added.

Email Verification Is Now Mandatory.

Forum Description Added In Spoiler / Drop Down Container For Better Viewing Experience For Desktops And Mobile.

Premium Forum Added For Paid Advertisement Of Your Services.

More New Forums Are On Their Way Releasing Soon ...

100s Of New Smileys ...

Announcement

Hello On Board Crew

Porn Content Is Strictly Prohibited

Please Go For Better Tittles For Posting And Strictly Language Should Be English For Tittles ...

Henceforth The Content Should Be In English 1st And Then You Can Add Your Own Language Below Of English Content!!

Rules Are Rule !!!
If You Fail To Follow Them Post Will Be Deleted And Account Will Be Either Deleted Or Deactivated ...

Consider For Donation
CRYPTO DONATATION
PAYPAL DONATATION

[PHP][DDNS][Namecheap] Namecheap DDNS Update Script - Dynamic IP

Namecheap DDNS Update Script - Dynamic IP

Image
► Show Spoiler
http://links.darkdroid.tech/programming
:
:

Reviews For This Post

You may select 1 option

 
 
View results

User avatar
zAce
Admin
Admin
Posts: 236
Contact:

[PHP][DDNS][Namecheap] Namecheap DDNS Update Script - Dynamic IP

Post#1 » Thu Dec 27, 2018 10:52 pm

Namecheap DDNS Update Script - Dynamic IP

Go To Namecheap Account
Go To Domain List >> Manage >> Select Namecheap BasicDNS For Nameservers
Next Go To Advanced DNS >> Enable DYNAMIC DNS (Second Last Option If You Dont See It Then Its Because You Haven't Changed Nameservers)

Next Create Host @ With Any IP Or 127.0.0.1

Image

Image

Image

Image

Then Edit The namecheap.sh With Your Details

To Force Update Script Delete IP.txt File

cron
@reboot /home/path_to_namecheap/namecheap/c.sh or namecheap.sh
*/5 * * * * /home/path_to_namecheap/namecheap/c.sh or namecheap.sh


Code: Select all

#!/bin/bash

#Mood By DarkDroid - DD

#Namecheap Account Details
pass="7856eb48843443739642a29c60098175" # found in namecheap account settings
domain="yourdomain.com"
host="@"

#Getting IP
ip=$(curl -s https://ifconfig.me/)
ip_file="ip.txt"
log_file="namecheap.log"
update_file="update_details.xml"

# LOGGING
log() {
    if [ "$1" ]; then
        echo -e "[$(date)] - $1" >> $log_file
    fi
}

# SCRIPT BEGINS
log "Check Initiated"

if [ -f $ip_file ]; then
    old_ip=$(cat $ip_file)
    if [ $ip == $old_ip ]; then
        echo "IP has not changed Old Ip - $old_ip."
        exit 0
    fi
fi

#Update Link
update=$(curl -s "https://dynamicdns.park-your-domain.com/update?host=$host&domain=$domain&password=$pass&ip=$ip")

if [[ $update == *"\"success\":false"* ]]; then
    message="API UPDATE FAILED. DUMPING RESULTS:\n$update"
    log "$message"
    echo -e "$message"
    exit 1
else
    message="IP changed to: $ip"
    echo "$ip" > $ip_file
   echo "$update" > $update_file
    log "$message"
    echo "$message"
fi
#Mood By DarkDroid - DD


Image




Contribute With Your Knowledge And Win VIP Membership For Free
Post On Empty Topics Or Topics Which Shows Unknown Solutions

Image

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest

DarkDroid - DD : Disclaimer