Linux shell script and PHP

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
Unknown
New php-forum User
New php-forum User
Posts: 9
Joined: Mon Jan 13, 2003 10:33 am

Post by Unknown » Thu Jan 16, 2003 1:36 pm

Hello to all, Im new to PHP but this might work, Please correct me if im wrong.

$rueckgabe = `/var/www/Intranet/Server_Status/scripte/ssh.sh`

User avatar
WiZARD
Moderator
Moderator
Posts: 1256
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: Linux shell script and PHP

Post by WiZARD » Fri Jan 17, 2003 1:22 am

Yes you have mistake in your code, change at this:

Code: Select all

$rueckgabe = exec(`/var/www/Intranet/Server_Status/scripte/ssh.sh`);
    echo $rueckgabe;
        if ( $rueckgabe == "..done" ) {
            $status = "32CD32";
        } else {
            $status = "#ff0000";
        }      

By the way, you may use next:

Code: Select all

$rueckgabe = exec(`/var/www/Intranet/Server_Status/scripte/ssh.sh`);
       if ( $rueckgabe == false ) {
      echo ("Sorry....");
            $status = "#ff0000";
        } else {
      echo ("....Done");
            $status = "32CD32";
        }      

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests