
How do I read a ini file to initialize variables
. currentip.conf
But be sure that you have control over the contents of the file,
and that no-one can introduce malicious code into it.
If you can't be sure of that, use something that only assigns
variables you designate, and doesn't execute any other code:
while read line
do
case $line in
current_ip=*) current_ip=${line#*=} ;;
other_var=*) other_var=${line#*=} ;;
esac
done < currentip.conf
If you don't have a POSIX shell (/bin/sh often is), use:
var=`echo "$line" | cut -d= -f2-`
Put the job in root's crontab.
If you don't have the authority to do that, you probably shouldn't
be messing around with that directory.
--
Chris F.A. Johnson bq...@torfree.net
=================================================================
c.f.a.john...@rogers.com http://cfaj.freeshell.org
c...@freeshell.org http://members.rogers.com/c.f.a.johnson