12 lines
220 B
Bash
12 lines
220 B
Bash
|
#!/usr/bin/sh
|
||
|
|
||
|
if [[ $1 ]]; then
|
||
|
char_num=$1;
|
||
|
else
|
||
|
char_num=64;
|
||
|
fi
|
||
|
|
||
|
cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*' | fold -w $char_num | head -n 1 | systemd-creds encrypt -p - /tmp/salt
|
||
|
|
||
|
cat /tmp/salt
|
||
|
rm /tmp/salt
|