I have created a Linux daemon (in C language) to send certain information via UDP to another computer. It requires of course the remote IP address and the port number. I store this daemon in /usr/local/bin/
and I also created a script in /etc/init.d/
to start|stop|restart the daemon.
So far, the IP address and the port number are passed to the daemon, directly by the script. By example, the start() part of the script looks like this:
start() {
/usr/local/bin/lvsload_udp_s 192.168.122.25 47239
}
So, when the remote IP and/or port number changes, I have to modify my script, instead of modifying some configuration file. It is a bad practice, I know.
What is the best way of passing the arguments to my daemon? Thanks