Split the server status scripts

Jonathan Hodgson 7 years ago
parent 79f4846c61
commit 966a93ff2b
  1. 16
      i3/blocks/apache
  2. 16
      i3/blocks/mysql
  3. 16
      i3/blocks/proftp
  4. 11
      i3/blocks/server

@ -0,0 +1,16 @@
#!/usr/bin/sh
LAMPP='/opt/lampp/lampp'
STATUS=$($LAMPP status 2> /dev/null)
APACHE=$(echo "$STATUS" | grep -i apache | grep -io not > /dev/null && echo "down" || echo "up")
if [ "$APACHE" = "up" ]; then
COLOUR="#00FF00"
else
COLOUR="#FF0000"
fi
echo "Apache"
echo ""
echo "$COLOUR"

@ -0,0 +1,16 @@
#!/usr/bin/sh
LAMPP='/opt/lampp/lampp'
STATUS=$($LAMPP status 2> /dev/null)
MYSQL=$(echo "$STATUS" | grep -i mysql | grep -io not > /dev/null && echo "down" || echo "up")
if [ "$MYSQL" = "up" ]; then
COLOUR="#00FF00"
else
COLOUR="#FF0000"
fi
echo "MySQL"
echo ""
echo "$COLOUR"

@ -0,0 +1,16 @@
#!/usr/bin/sh
LAMPP='/opt/lampp/lampp'
STATUS=$($LAMPP status 2> /dev/null)
PROFTP=$(echo "$STATUS" | grep -i proftp | grep -io not > /dev/null && echo "down" || echo "up")
if [ "$PROFTP" = "up" ]; then
COLOUR="#00FF00"
else
COLOUR="#FF0000"
fi
echo "ProFTP"
echo ""
echo "$COLOUR"

@ -1,11 +0,0 @@
#!/usr/bin/sh
LAMPP='/opt/lampp/lampp'
STATUS=$($LAMPP status 2> /dev/null)
APACHE=$(echo "$STATUS" | grep -i apache | grep -io not > /dev/null && echo "down" || echo "up")
MYSQL=$(echo "$STATUS" | grep -i mysql | grep -io not > /dev/null && echo "down" || echo "up")
PROFTP=$(echo "$STATUS" | grep -i proftp | grep -io not > /dev/null && echo "down" || echo "up")
echo "Apache: $APACHE MySQL: $MYSQL ProFTP: $PROFTP"
Loading…
Cancel
Save