Make shellcheck happy + minor cleanups

This commit is contained in:
2017-06-20 10:25:42 +03:00
parent f10b75c4b7
commit caa0e2b6a7
4 changed files with 13 additions and 13 deletions

View File

@@ -1,18 +1,18 @@
#!/bin/bash #!/bin/bash
printf "Password for 'rmps' DB user: " printf "Password for 'rmps' DB user: "
read -s dbpass read -rs dbpass
printf "\nEnter the first RMPS username: " printf "\nEnter the first RMPS username: "
read username read -r username
printf "Full name for the new user '$username': " printf "Full name for the new user '%s': " "${username}"
read fullname read -r fullname
printf "Password for RMPS user '$username': " printf "Password for RMPS user '%s': " "${username}"
read -s newuser_pass read -rs newuser_pass
printf "\nEnter e-mail for the new user: " printf "\nEnter e-mail for the new user: "
read email read -r email
printf "Initializing DB... " printf "Initializing DB... "
salt=`head -c 32 /dev/urandom|sha1sum|head -c 32` salt=$(head -c 32 /dev/urandom|sha1sum|head -c 32)
pass_hash=`printf ${newuser_pass}${salt}|sha512sum|head -c 128` pass_hash=$(printf "%s%s" "${newuser_pass}" "${salt}"|sha512sum|head -c 128)
#printf "\nSalt = $salt" #printf "\nSalt = $salt"
#printf "\nHash = $pass_hash\n" #printf "\nHash = $pass_hash\n"
@@ -23,5 +23,5 @@ mysql -u rmps --password="$dbpass" -e "\
set @eMail=\"$email\";\ set @eMail=\"$email\";\
set @passHash=\"$pass_hash\";\ set @passHash=\"$pass_hash\";\
set @passSalt=\"$salt\";\ set @passSalt=\"$salt\";\
`cat init_rmps_db.sql`" $(cat init_rmps_db.sql)"
printf 'Done!\n' printf "Done!\n"

View File

@@ -180,4 +180,3 @@ END $$
DELIMITER ; DELIMITER ;

View File

@@ -10,3 +10,4 @@ int start_job_queue(int poolsize);
int add_msg_to_queue(int id, struct msg_t buf); int add_msg_to_queue(int id, struct msg_t buf);
#endif /* JOB_QUEUE_H */ #endif /* JOB_QUEUE_H */

View File

@@ -22,7 +22,7 @@ rmps.client_port=7001
rmps.loglevel=4 rmps.loglevel=4
rmps.logfile=/home/smirky/projects/rmps/tmp/rmpsd.log rmps.logfile=/home/smirky/projects/rmps/tmp/rmpsd.log
rmps.errlog=/home/smirky/projects/rmps/tmp/rmpsd.err 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 #rmps.pidfile=/home/smirky/stuff/projects/rmps/rmpsd/rmpsd.pid
# Cryptography settings # Cryptography settings