Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

Is $hostname set in your environment ...

Yes its being set externally.

Maybe consider using a command line argument, that's a bit more obvious.

The inner while loop could be replaced with a for loop for counting. And curl defaults to stdout, so you could use that instead of wget.

Now, since you're using lsof the server is running on your machine, right? In that case you should probably have the PID of the server process somewhere or you can also use ps/pgrep to check whether it is running (before restarting it I mean).

Rest looks good I think.

Is $hostname set in your environment ...

Yes its being set externally.

Maybe consider using a command line argument, that's a bit more obvious.

The inner while loop could be replaced with a for loop for counting. And curl defaults to stdout, so you could use that instead of wget.

Now, since you're using lsof the server is running on your machine, right? In that case you should probably have the PID of the server process somewhere or you can also use ps/pgrep to check whether it is running (before restarting it I mean).

Rest looks good I think.

Is $hostname set in your environment ...

Yes its being set externally.

Maybe consider using a command line argument, that's a bit more obvious.

The inner while loop could be replaced with a for loop for counting. And curl defaults to stdout, so you could use that instead of wget.

Now, since you're using lsof the server is running on your machine, right? In that case you should probably have the PID of the server process somewhere or you can also use ps/pgrep to check whether it is running (before restarting it I mean).

Rest looks good I think.

Source Link
ferada
  • 11.4k
  • 25
  • 65

Is $hostname set in your environment ...

Yes its being set externally.

Maybe consider using a command line argument, that's a bit more obvious.

The inner while loop could be replaced with a for loop for counting. And curl defaults to stdout, so you could use that instead of wget.

Now, since you're using lsof the server is running on your machine, right? In that case you should probably have the PID of the server process somewhere or you can also use ps/pgrep to check whether it is running (before restarting it I mean).

Rest looks good I think.

lang-bash

AltStyle によって変換されたページ (->オリジナル) /