From e509155207c671eef877800ec385b59ce9b4cf01 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Feb 2022 23:41:47 +0200 Subject: [PATCH] 1 --- README.md | 2 ++ mysql-create-superuser.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 README.md create mode 100755 mysql-create-superuser.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf271f4 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +* + diff --git a/mysql-create-superuser.sh b/mysql-create-superuser.sh new file mode 100755 index 0000000..c8f1f24 --- /dev/null +++ b/mysql-create-superuser.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +PWGEN=`which pwgen` +if [ -z "${PWGEN}" ]; +then + echo "Could not finf \"pwgen\" binary" + exit 1 +fi + +AUTOGEN_PASSWORD=`pwgen -n1 -v 40` +USERNAME="$1" + +if [ -z "${USERNAME}" ]; +then + echo "Missing username" + exit 1 +fi + +cat <