You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
711 B
49 lines
711 B
7 years ago
|
#!/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")
|
||
|
|
||
7 years ago
|
COLOUR=""
|
||
|
|
||
7 years ago
|
function toggleMysql(){
|
||
|
if [ $MYSQL = "up" ]; then
|
||
|
gksudo $LAMPP stopmysql
|
||
|
else
|
||
|
gksudo $LAMPP startmysql
|
||
7 years ago
|
COLOUR="#FF8000"
|
||
7 years ago
|
fi
|
||
|
}
|
||
|
|
||
|
function toggleAll(){
|
||
|
if [ $MYSQL = "up" ]; then
|
||
|
gksudo $LAMPP stop
|
||
|
else
|
||
|
gksudo $LAMPP start
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
case $BLOCK_BUTTON in
|
||
|
1) toggleMysql ;;
|
||
|
3) toggleAll ;;
|
||
|
esac
|
||
|
|
||
7 years ago
|
if [ "$MYSQL" = "up" ]; then
|
||
|
COLOUR="#00FF00"
|
||
|
else
|
||
|
COLOUR="#FF0000"
|
||
|
fi
|
||
|
|
||
7 years ago
|
if [ -z "$COLOUR" ]; then
|
||
|
if [ "$APACHE" = "up" ]; then
|
||
|
COLOUR="#00FF00"
|
||
|
else
|
||
|
COLOUR="#FF0000"
|
||
|
fi
|
||
|
fi
|
||
|
|
||
7 years ago
|
echo "MySQL"
|
||
|
echo ""
|
||
|
echo "$COLOUR"
|