Make shellcheck happy + minor cleanups
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
printf "Password for 'rmps' DB user: "
|
||||
read -s dbpass
|
||||
read -rs dbpass
|
||||
printf "\nEnter the first RMPS username: "
|
||||
read username
|
||||
printf "Full name for the new user '$username': "
|
||||
read fullname
|
||||
printf "Password for RMPS user '$username': "
|
||||
read -s newuser_pass
|
||||
read -r username
|
||||
printf "Full name for the new user '%s': " "${username}"
|
||||
read -r fullname
|
||||
printf "Password for RMPS user '%s': " "${username}"
|
||||
read -rs newuser_pass
|
||||
printf "\nEnter e-mail for the new user: "
|
||||
read email
|
||||
read -r email
|
||||
printf "Initializing DB... "
|
||||
salt=`head -c 32 /dev/urandom|sha1sum|head -c 32`
|
||||
pass_hash=`printf ${newuser_pass}${salt}|sha512sum|head -c 128`
|
||||
salt=$(head -c 32 /dev/urandom|sha1sum|head -c 32)
|
||||
pass_hash=$(printf "%s%s" "${newuser_pass}" "${salt}"|sha512sum|head -c 128)
|
||||
|
||||
#printf "\nSalt = $salt"
|
||||
#printf "\nHash = $pass_hash\n"
|
||||
@@ -23,5 +23,5 @@ mysql -u rmps --password="$dbpass" -e "\
|
||||
set @eMail=\"$email\";\
|
||||
set @passHash=\"$pass_hash\";\
|
||||
set @passSalt=\"$salt\";\
|
||||
`cat init_rmps_db.sql`"
|
||||
printf 'Done!\n'
|
||||
$(cat init_rmps_db.sql)"
|
||||
printf "Done!\n"
|
||||
|
||||
@@ -180,4 +180,3 @@ END $$
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
|
||||
@@ -10,3 +10,4 @@ int start_job_queue(int poolsize);
|
||||
int add_msg_to_queue(int id, struct msg_t buf);
|
||||
|
||||
#endif /* JOB_QUEUE_H */
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ rmps.client_port=7001
|
||||
rmps.loglevel=4
|
||||
rmps.logfile=/home/smirky/projects/rmps/tmp/rmpsd.log
|
||||
rmps.errlog=/home/smirky/projects/rmps/tmp/rmpsd.err
|
||||
rmps.pidfile=/home/smirky/projects/rmps/tmp/rmpsd.pig
|
||||
rmps.pidfile=/home/smirky/projects/rmps/tmp/rmpsd.pid
|
||||
#rmps.pidfile=/home/smirky/stuff/projects/rmps/rmpsd/rmpsd.pid
|
||||
|
||||
# Cryptography settings
|
||||
|
||||
Reference in New Issue
Block a user