diff --git a/src/freedombone b/src/freedombone index 34188f1a..ecc7b523 100755 --- a/src/freedombone +++ b/src/freedombone @@ -8294,7 +8294,7 @@ function install_mariadb { get_mariadb_password if [ ! $MARIADB_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - MARIADB_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + MARIADB_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else MARIADB_PASSWORD="$(openssl rand -base64 32)" fi @@ -8554,7 +8554,7 @@ function install_owncloud { get_mariadb_owncloud_admin_password if [ ! $OWNCLOUD_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - OWNCLOUD_ADMIN_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + OWNCLOUD_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else OWNCLOUD_ADMIN_PASSWORD="$(openssl rand -base64 32)" fi @@ -8813,7 +8813,7 @@ function install_gogs { get_mariadb_git_admin_password if [ ! $GIT_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - GIT_ADMIN_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + GIT_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else GIT_ADMIN_PASSWORD="$(openssl rand -base64 32)" fi @@ -9255,7 +9255,7 @@ function install_xmpp { if ! grep -q "Your XMPP password is" /home/$MY_USERNAME/README; then if [ -f $IMAGE_PASSWORD_FILE ]; then - XMPP_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + XMPP_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else XMPP_PASSWORD="$(openssl rand -base64 8)" fi @@ -9341,7 +9341,7 @@ function install_irc_server { sed -i 's/;CloakHost = cloaked.host/CloakHost = freedombone/g' /etc/ngircd/ngircd.conf IRC_SALT="$(openssl rand -base64 32)" if [ -f $IMAGE_PASSWORD_FILE ]; then - IRC_OPERATOR_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + IRC_OPERATOR_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else IRC_OPERATOR_PASSWORD="$(openssl rand -base64 8)" fi @@ -9468,7 +9468,7 @@ function install_wiki { get_wiki_admin_password if [ ! $WIKI_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - WIKI_ADMIN_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + WIKI_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else WIKI_ADMIN_PASSWORD="$(openssl rand -base64 16)" fi @@ -9908,7 +9908,7 @@ function install_blog { get_blog_admin_password if [ ! $FULLBLOG_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - FULLBLOG_ADMIN_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + FULLBLOG_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else FULLBLOG_ADMIN_PASSWORD="$(openssl rand -base64 16)" fi @@ -9984,7 +9984,7 @@ function install_gnu_social { get_mariadb_gnusocial_admin_password if [ ! $MICROBLOG_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - MICROBLOG_ADMIN_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + MICROBLOG_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else MICROBLOG_ADMIN_PASSWORD="$(openssl rand -base64 32)" fi @@ -10263,7 +10263,7 @@ function install_hubzilla { get_mariadb_hubzilla_admin_password if [ ! $HUBZILLA_ADMIN_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - HUBZILLA_ADMIN_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + HUBZILLA_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else HUBZILLA_ADMIN_PASSWORD="$(openssl rand -base64 32)" fi @@ -11312,7 +11312,7 @@ function install_voip { get_voip_server_password if [ ! $VOIP_SERVER_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - VOIP_SERVER_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + VOIP_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else VOIP_SERVER_PASSWORD="$(openssl rand -base64 16)" if [ ${#VOIP_SERVER_PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then @@ -11403,7 +11403,7 @@ function install_sip { get_sip_server_password if [ ! $SIP_SERVER_PASSWORD ]; then if [ -f $IMAGE_PASSWORD_FILE ]; then - SIP_SERVER_PASSWORD="$(cat $IMAGE_PASSWORD_FILE)" + SIP_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)" else SIP_SERVER_PASSWORD="$(openssl rand -base64 10)" fi diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 37a28d9c..2755178c 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -222,7 +222,7 @@ EOF if [ -f ~/.initial_setup ]; then EOF echo ' if [ -f ~/login.txt ]; then' >> $rootdir/root/.bashrc - echo ' NEW_USER_PASSWORD=$(cat ~/login.txt)' >> $rootdir/root/.bashrc + echo ' NEW_USER_PASSWORD=$(printf `cat ~/login.txt`)' >> $rootdir/root/.bashrc echo ' else' >> $rootdir/root/.bashrc echo ' ENTROPY=$(cat /proc/sys/kernel/random/entropy_avail)' >> $rootdir/root/.bashrc echo ' if [ $ENTROPY -lt 500]; then' >> $rootdir/root/.bashrc @@ -240,7 +240,7 @@ EOF EOF # change the password for the admin user echo -n " echo \"${MY_USERNAME}:" >> $rootdir/root/.bashrc - echo -n '$(cat ~/login.txt)"|chpasswd' >> $rootdir/root/.bashrc + echo -n '$(printf `cat ~/login.txt`)"|chpasswd' >> $rootdir/root/.bashrc # Remove the initial setup files echo " rm /root/.initial_setup" >> $rootdir/root/.bashrc