diff --git a/db_scripts/init_rmps_db.sh b/db_scripts/init_rmps_db.sh index fd76c20..99dcd59 100755 --- a/db_scripts/init_rmps_db.sh +++ b/db_scripts/init_rmps_db.sh @@ -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" diff --git a/db_scripts/init_rmps_db.sql b/db_scripts/init_rmps_db.sql index 3f98adb..cdad988 100644 --- a/db_scripts/init_rmps_db.sql +++ b/db_scripts/init_rmps_db.sql @@ -180,4 +180,3 @@ END $$ DELIMITER ; - diff --git a/job_queue.h b/job_queue.h index 387b2de..da9dfa4 100644 --- a/job_queue.h +++ b/job_queue.h @@ -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 */ + diff --git a/rmps.conf b/rmps.conf index ba91bbb..ea458cb 100644 --- a/rmps.conf +++ b/rmps.conf @@ -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