First off, let me congratulate you: this is by far the best first posting i have read here for ages. You even seem to understand how to use CODE-tags, which will earn you the eternal respect and heartfelt thankfulness of the complete moderation team.
Quote:
Originally Posted by
regexp
Is this ok? Is there a better way ?
This is OK. In fact, start-/stop-scripts have been written this way for a long time.
Just as a suggestion, you might want to add a "restart" function, which simply consists of a call to "stop()" first and then a call to "start()".
Another suggestion: do you really want to hard-code the IP address into a rc-script? You might want to make the script more generic by obtaining the IP-address in its own script. This would either read it from some configuration file or get it via DHCP, bootp or the like.
I hope this helps.
bakunin