Skip to content

Instantly share code, notes, and snippets.

@ciavashkh
Last active April 26, 2017 16:22
Show Gist options
  • Save ciavashkh/92e569002ff5979326f365e3365a4ef9 to your computer and use it in GitHub Desktop.
Save ciavashkh/92e569002ff5979326f365e3365a4ef9 to your computer and use it in GitHub Desktop.
functions to check server
function c66_test_website {
curl -w "
time_namelookup: %{time_namelookup}
time_connect: %{time_connect}
time_appconnect: %{time_appconnect}
time_pretransfer: %{time_pretransfer}
time_redirect: %{time_redirect}
time_starttransfer: %{time_starttransfer}
-------------------
time_total: %{time_total}
" -o /dev/null -s $1
}
function c66_test_nginx {
echo "number of nginx processes:" $(ps aux | grep [n]ginx | wc -l)
is_version_less_than_16=$(echo $(lsb_release --short --release)'<'16.04 | bc -l)
if [ $is_version_less_than_16 -eq 1 ]
then
echo "Nginx service status is:"
sudo service nginx status
else
echo "Nginx service status is:"
sudo service nginx status | grep Active
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment