From 22949796896fbae43995ccd433e6d8a71d04a84e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Nov 2015 15:04:05 +0000 Subject: [PATCH] Random initial image password --- src/freedombone-image-customise | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 68255cf7..d8e0070a 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -186,16 +186,16 @@ admin_user_sudo() { create_generic_image() { if [[ $GENERIC_IMAGE == "no" ]]; then - return - fi + return + fi # Don't install any configuration. This will be a base system CONFIG_FILENAME= - # The presence of this file indicates that the initial - # setup has not yet been completed + # The presence of this file indicates that the initial + # setup has not yet been completed touch $rootdir/home/$MY_USERNAME/.initial_setup touch $rootdir/home/root/.bashrc - cat >> $rootdir/home/$MY_USERNAME/.bashrc <> $rootdir/home/$MY_USERNAME/.bashrc < ~/login.txt echo " $NEW_USER_PASSWORD" echo '' @@ -226,11 +226,19 @@ if [ -f ~/.initial_setup ]; then fi EOF - cat >> $rootdir/home/root/.bashrc <> $rootdir/home/root/.bashrc <> /home/root/.bashrc + echo -n '$(cat /home/' >> /home/root/.bashrc + echo "${MY_USERNAME}/login.txt)\"|chpasswd" >> /home/root/.bashrc + cat >> $rootdir/home/root/.bashrc <> $rootdir/home/root/.bashrc + cat >> $rootdir/home/root/.bashrc <