17 lines
342 B
Bash
Executable File
17 lines
342 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "please specify a username"
|
|
exit 1
|
|
fi
|
|
|
|
password=$(echo $RANDOM$RANDOM$RANDOM | md5sum | awk '{print $1}')
|
|
echo "Username: $1"
|
|
echo "Password: $password"
|
|
password=$(echo -n $password | sha256sum | awk '{print $1}')
|
|
|
|
sqlite3 db/data.db << EOF
|
|
INSERT INTO users VALUES ('$1','$password','notset')
|
|
EOF
|
|
|