Restructure functions

This commit is contained in:
2022-08-12 00:39:41 +08:00
parent 5fe9b2ef34
commit 123b2942e9
4 changed files with 21 additions and 29 deletions

View File

@@ -1,5 +1,18 @@
#!/bin/bash
function grepmysql {
if [[ -z "$1" ]]; then
__func_head "MySQL_SERVER_NAME [WITH_OPTIONS]"
echo
else
if [[ -z "$2" ]]; then
grep -i $1 ~/.mysql_pass | awk 'BEGIN{FS=":"}{ print $2 }'
else
grep -i $1 ~/.mysql_pass | awk 'BEGIN{FS=":"}{ print $2" "$3 }'
fi
fi
}
function mysqlo () {
if [ -z "$1" ]; then
__func_head "SERVER_NAME"