LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-20-2024, 07:23 PM   #1
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 269

Rep: Reputation: 26
Question noip3 / noip-duc - script for boot


Hi there some days ago i download and install "noip3" client using the follow commands

Code:
#Install noip client :
mkdir /tmp/noip
cd /tmp/noip
wget https://dmej8g5cpdyqd.cloudfront.net/downloads/noip-duc_3.0.0.tar.gz
tar xf noip-duc_3.0.0.tar.gz
cd noip-duc_3.0.0/binaries
deb2tgz noip-duc_3.0.0_amd64.deb
su -c "installpkg noip-duc_3.0.0_amd64.txz ; ldconfig" root
Code:
#Removing noipclient :
su -c "removepkg noip-duc_3.0.0_amd64.txz ; ldconfig" root
Contraseņa:
Removing package: noip-duc_3.0.0_amd64
Removing files:
  --> Deleting /lib/systemd/system/noip-duc.service
  --> Deleting /usr/bin/noip-duc
  --> Deleting /usr/share/doc/noip-duc/README.md
  --> Deleting /usr/share/doc/noip-duc/copyright
  --> Deleting empty directory /usr/share/doc/noip-duc/
Well if you notice just one file relevant, the binary executable client.

Configuring the things, like my account on "noip" website, password, ddns data.

On some moment i should use the follow command :
Code:
iptables -I INPUT -s [DISIRED_IP] -p tcp -m tcp --dport [DESIRED_PORT] -j ACCEPT
iptables -I INPUT -s [DISIRED_IP] -p udp -m udp --dport [DESIRED_PORT] -j ACCEPT

echo 'on more clear example :'
iptables -I INPUT -s inukazenoip.redirectme.net -p tcp -m tcp --dport 22 -j ACCEPT

iptables -I INPUT -s inukazenoip.redirectme.net -p udp -m udp --dport 22 -j ACCEPT
Well the thing is i am thinking how i should write my script for start noip client during boot, by the moment i had just write the follow

Code:
#!/usr/bin/env bash
# Author    :	Inukaze ( Venezuela )
# WebSite   :	http://https://goo.gl/ij6WqW
# E-Mail    :	bloginukaze@gmail.com
# License   :	GPL 2

function noip-duc()
{
noipduc=$(whereis -B "/usr/sbin" "/usr/local/sbin" "/sbin" "/usr/bin" "/usr/local/bin" "/bin" -b noip-duc | grep -i "noip-duc" | cut -d " " -f02 | sed 's/[/]noip-duc//')

noipduc=$(echo "$noipduc/noip-duc")

while getopts u:p: flag
do
    case "${flag}" in
        u) username=${OPTARG};;
        p) password=${OPTARG};;
    esac
done
echo "Username: $username";
echo "Password: $password";
}

start() {
	if ! /sbin/route -n | grep "^0.0.0.0" 1> /dev/null ; then
		echo "Gateway not defined yet, please init the network services."
		exit 0;
	fi
	echo "Starting no-ip client daemon: "
	"$noipduc/noip-duc" --username "$username" --password "$password"
}

stop() {
		echo "Stopping no-ip client daemon: ";
		for i in `"$noipduc" 2>&1 | grep Process | awk '{print $2}' | tr -d ','`
		do
			killall -9 "$noipduc"
		done
	else
		echo "no-ip client daemon is not running" && exit 0
	fi
}

status() {
	if "$noip-duc" 2>&1 | grep Process 1>/dev/null ; then
		echo "no-ip client daemon is running"
	else
		echo "no-ip client daemon is not runnig"
	fi
}

restart() {
	stop
	sleep 1
	start
}

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  status)
	status
	;;
  restart)
  	restart
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
esac
i think saved like /etc/rc.d/rc.noip

But someone had a better idea for this.
 
Old 03-21-2024, 12:11 PM   #2
RudyMartin
Member
 
Registered: Nov 2011
Location: Argentina
Distribution: Slackware, Debian
Posts: 38

Rep: Reputation: Disabled
Quote:
Originally Posted by inukaze View Post
But someone had a better idea for this.
I fail to see your specific question but assuming you want to know if there's a better approach, I use afraid.org service. Updating the dynamic dns is just a wget line which you can get from the site when you register a subdomain. After, it all depends on how stable is your connection and ip address allocation time frame and what and how important are the services you are running on your "server". Best case scenario you might want to run an update once a day. Worst case scenario you might want to check your current public ip address (command ifconfig or ip a s) and compare with the public registered on your dynamic dns (command resolveip and egrep to extract ip) and run updates every ten minutes or any number you consider safe.


ymmv. hope it helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NO- IP INSTALL tar: noip-duc-linux.tar.gz: Cannot open: No such file or directory VernaS Linux - Newbie 9 04-11-2020 08:14 PM
compile errors installing noip dynamicDNS software anarchrazy Linux - Software 2 03-21-2006 12:00 PM
noip daemon startup help rino.caldelli Linux - Networking 2 02-19-2006 03:39 AM
Script to start NoIP at boot downinthemine Linux - Software 3 04-20-2004 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration