This commit is contained in:
Bob Mottram 2015-11-23 17:08:31 +00:00
parent 4ede9b7028
commit 8c7929e4b0
1 changed files with 8 additions and 6 deletions

View File

@ -213,11 +213,13 @@ if [ -f ~/.initial_setup ]; then
echo 'This is your new password. Use whenever you wish to ssh into' echo 'This is your new password. Use whenever you wish to ssh into'
echo 'this system.' echo 'this system.'
echo '' echo ''
EOF
NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)" echo ' NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)"' >> $rootdir/root/.bashrc
echo "${NEW_USER_PASSWORD}" > ~/login.txt echo ' echo "${NEW_USER_PASSWORD}" > ~/login.txt' >> $rootdir/root/.bashrc
echo " $NEW_USER_PASSWORD" echo ' echo " $NEW_USER_PASSWORD"' >> $rootdir/root/.bashrc
cat >> $rootdir/home/$MY_USERNAME/.bashrc <<EOF
echo '' echo ''
echo 'Copy it into a password manager or write it down somewhere.' echo 'Copy it into a password manager or write it down somewhere.'
echo '' echo ''
@ -232,9 +234,9 @@ EOF
# initial setup of the system # initial setup of the system
if [ -f ~/.initial_setup ]; then if [ -f ~/.initial_setup ]; then
EOF EOF
echo -n " echo \"${MY_USERNAME}:" >> /root/.bashrc echo -n " echo \"${MY_USERNAME}:" >> $rootdir/root/.bashrc
echo -n '$(cat /home/' >> /root/.bashrc echo -n '$(cat /home/' >> $rootdir/root/.bashrc
echo "${MY_USERNAME}/login.txt)\"|chpasswd" >> /root/.bashrc echo "${MY_USERNAME}/login.txt)\"|chpasswd" >> $rootdir/root/.bashrc
cat >> $rootdir/root/.bashrc <<EOF cat >> $rootdir/root/.bashrc <<EOF
freedombone menuconfig freedombone menuconfig
rm ~/.initial_setup rm ~/.initial_setup