Thanks for this very instructive article! Here are a couple of bash tricks you may use to slightly simplify your scripts:
Instead of using a retry loop, the random numbers can be generated with
echo$((floor + RANDOM %(range - floor +1)))
A very old trick used to avoid grepping-out grep:
grep"[n]ginx: worker process"
But note that you may be able to avoid grep if you can ask ps to display only the relevant processes. On Ubuntu, you may select the process that are owned by www-data:
echo$(ps --no-header-u www-data | wc-l)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for this very instructive article! Here are a couple of bash tricks you may use to slightly simplify your scripts:
But note that you may be able to avoid grep if you can ask ps to display only the relevant processes. On Ubuntu, you may select the process that are owned by www-data: