diff --git a/install.conf.yaml b/install.conf.yaml index 39ae871..6823f1a 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -41,7 +41,6 @@ ~/.profile.d/10-liquidprompt.sh: shell/liquidprompt.sh ~/.profile.d/20-aliases.sh: shell/aliases.sh ~/.profile.d/20-cd.sh: shell/cd.sh - ~/.profile.d/40-mysqlpw.sh: shell/mysqlpw.sh ~/.profile.d/81-fzf.sh: shell/fzf.sh ~/.profile.d/82-direnv.sh: shell/direnv.sh ~/.profile.d/90-keychain.sh: shell/keychain.sh diff --git a/shell/mysqlpw.sh b/shell/mysqlpw.sh deleted file mode 100755 index 9701e11..0000000 --- a/shell/mysqlpw.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -#The function will find the given user and search for a mysql-password -#in the home-directory, which will get printed out! -#arg1: user where to find a config-file -# if not given, it uses the current user in the $HOME and $USER-Variable - -mysqlpw() { - _mysqlpw_H=$HOME - _mysqlpw_U=$USER - - # use different user, if arg1 given - if [ -n "$1" ]; then - - # check if given user is even existing - if ! id "$1" >/dev/null 2>/dev/null; then - echo user "$1" not existing >&2 - return 1 - fi - - _mysqlpw_U=$1 - _mysqlpw_H=$(grep ^"$1": /etc/passwd | cut -d ":" -f 6) - - fi; - - _mysqlpw_cnf="$_mysqlpw_H/.my.cnf" - - if [ ! -e "$_mysqlpw_cnf" ]; then - echo "$_mysqlpw_cnf" not existing >&2 && return 1 - fi - - if [ ! -r "$_mysqlpw_cnf" ]; then - echo "$_mysqlpw_cnf" not readable >&2 && return 1 - fi - - _mysqlpw_PW=$( (grep "password=" "$_mysqlpw_cnf" || echo undefined) | cut -d "=" -f 2) - - echo MySQL-Password for user "$_mysqlpw_U" is "$_mysqlpw_PW" -}