Newer
Older
wordpress / generate_password.sh
@Pascal Gollor Pascal Gollor on 24 Dec 2017 412 bytes fix spelling bug
#!/bin/bash

if [ ! -f "wordpress.conf" ]; then
	cp wordpress.conf.example wordpress.conf

	pw1=$(</dev/urandom tr -dc A-Za-z0-9 | head -c 28)
	pw2=$(</dev/urandom tr -dc A-Za-z0-9 | head -c 28)

	sed -i "/^WORDPRESS_DATABASE_ROOT/c\\\WORDPRESS_DATABASE_ROOT=${pw1}" wordpress.conf
	sed -i "/^WORDPRESS_DATABASE_PASSWORD/c\\\WORDPRESS_DATABASE_PASSWORD=${pw2}" wordpress.conf
else
	echo "file already exists"
fi