Patch cut command for extracting root password

Use everything after first occurrence of the equals sign, and not only part between first end next equals sign.
This commit is contained in:
Alija Bobija authored and GitHub committed 2023-06-25 21:21:59 +02:00
1 parent 2f92dc3068
commit 35544ad580
1 file changed
+3 -3
+3 -3
View File
@@ -21,8 +21,8 @@ if [ ! -d $BACKUPDIR ]; then
fi
for i in $CONTAINER; do
MYSQL_DATABASE=$(docker exec $i env | grep MYSQL_DATABASE |cut -d"=" -f2)
MYSQL_PWD=$(docker exec $i env | grep MYSQL_ROOT_PASSWORD |cut -d"=" -f2)
MYSQL_DATABASE=$(docker exec $i env | grep MYSQL_DATABASE |cut -d"=" -f2-)
MYSQL_PWD=$(docker exec $i env | grep MYSQL_ROOT_PASSWORD |cut -d"=" -f2-)
docker exec -e MYSQL_DATABASE=$MYSQL_DATABASE -e MYSQL_PWD=$MYSQL_PWD \
$i /usr/bin/mysqldump -u root $MYSQL_DATABASE \
@@ -49,4 +49,4 @@ for i in $BITWARDEN_CONTAINERS; do
fi
done
echo "$TIMESTAMP Backup for Databases completed"
echo "$TIMESTAMP Backup for Databases completed"