mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2024-11-23 08:31:10 +01:00
Add helper scripts for generating WordPress salts
This commit is contained in:
parent
6c7a9812e0
commit
f2951e8d8b
1
bin/generate-wp-salts
Symbolic link
1
bin/generate-wp-salts
Symbolic link
|
@ -0,0 +1 @@
|
|||
../src/wp-utils/wp-generate-salts
|
7
src/wp-utils/wp-generate-salt
Executable file
7
src/wp-utils/wp-generate-salt
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
main() {
|
||||
local length="${1:?}"
|
||||
tr -dc 'a-zA-Z0-9!@#$%^&*()-=_+[]{};:,.<>?`~' </dev/urandom | head -c "${length}"
|
||||
}
|
||||
main "${@}"
|
14
src/wp-utils/wp-generate-salts
Executable file
14
src/wp-utils/wp-generate-salts
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
main() {
|
||||
local keys=("AUTH_KEY" "SECURE_AUTH_KEY" "LOGGED_IN_KEY" "NONCE_KEY" "AUTH_SALT" "SECURE_AUTH_SALT" "LOGGED_IN_SALT" "NONCE_SALT")
|
||||
local key
|
||||
local value
|
||||
|
||||
for key in "${keys[@]}"; do
|
||||
value="$(src/wp-utils/wp-generate-salt 64)"
|
||||
echo "WORDPRESS_${key}='${value}'"
|
||||
done
|
||||
}
|
||||
|
||||
main "${@}"
|
Loading…
Reference in New Issue
Block a user