Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ########################################
- # MySQL | MariaDB autologin
- # License: GNU GPL v3+
- # Author: Valerio Bozzolan
- ########################################
- file=/etc/mysql/debian.cnf
- while [ -z "$user" ] && read ln; do
- [[ "$ln" =~ user\ *=\ (.*)$ ]]
- user="${BASH_REMATCH[1]}"
- done < $file
- while [ -z "$pass" ] && read ln; do
- [[ "$ln" =~ password\ *=\ (.*)$ ]]
- pass="${BASH_REMATCH[1]}"
- done < $file
- mysql --user="$user" --password="$pass" $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement