Hai,
I want to open a few files on different server and collect them local to one server:
The server where i want to collect the files are in a database. From this database i'm getting the ipaddress trough a commandline mysql command.
the $1 is the Unique ID of the server where i want to collect.
Code:
USERID=root
PASSWD=
QUERY="SELECT ip FROM servers WHERE id=\"$1\";"
IP=`mysql -u "$USERID" -p"$PASSWD" DATABASE_1 -e "$QUERY" -s`
echo "$IP"
tunnel1=`ssh root@"$IP" "cat /root/file"`
echo "$tunnel1" > test.list
When i execute the script from the commandline everything works fine but when i want to call my script from a website(php) the $tunnel1 remains empty.
Does anyone have a idea?
thanks