Reputation: 514
PHP code:
$number_server = 10;
exec("/bin/bash wrun.sh $number_server",$wuptime);
Bash script:
#!/bin/sh
for i in `seq echo $1`; do
ssh /usr/local/bin/wrun 'uptime
ps -elf | grep httpd | wc -l
free - m;mpstat'
done &
pid=$!
sleep 3
kill -9 $pid && echo "not respond in give time"
In this I want to pass the argument $number_server
to the bash script from the php file.
Upvotes: 0
Views: 67