-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript
More file actions
executable file
·36 lines (24 loc) · 736 Bytes
/
script
File metadata and controls
executable file
·36 lines (24 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
echo Content-type: text/html
echo
echo "#########################################################"
echo "<br>"
echo "Mysql connection checking script"
echo "<br>"
echo "#########################################################"
echo "<br>"
echo "<br>"
db_user=`echo "$QUERY_STRING" | cut -f1 -d'&' | sed "s|user=||"`
db_password=`echo "$QUERY_STRING" | cut -f2 -d'&' | sed "s|pass=||"`
#echo $db_user
#echo $db_password
RESULT=`mysql --user="$db_user" --password="$db_password" --skip-column-names -e "SHOW DATABASES LIKE 'mysql'"` 2> /dev/null
if [ $RESULT ]; then
echo ""
echo "Username and password match"
a=2
break
else
echo ""
echo "Username and password doesn't match"
fi