Bob Mottram 9 年前
父节点
当前提交
8c7929e4b0
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8
    6
      src/freedombone-image-customise

+ 8
- 6
src/freedombone-image-customise 查看文件

213
     echo 'This is your new password. Use whenever you wish to ssh into'
213
     echo 'This is your new password. Use whenever you wish to ssh into'
214
     echo 'this system.'
214
     echo 'this system.'
215
     echo ''
215
     echo ''
216
+EOF
216
 
217
 
217
-    NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)"
218
-    echo "${NEW_USER_PASSWORD}" > ~/login.txt
219
-    echo "    $NEW_USER_PASSWORD"
218
+echo '    NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)"' >> $rootdir/root/.bashrc
219
+echo '    echo "${NEW_USER_PASSWORD}" > ~/login.txt' >> $rootdir/root/.bashrc
220
+echo '    echo "    $NEW_USER_PASSWORD"' >> $rootdir/root/.bashrc
220
 
221
 
222
+    cat >> $rootdir/home/$MY_USERNAME/.bashrc <<EOF
221
     echo ''
223
     echo ''
222
     echo 'Copy it into a password manager or write it down somewhere.'
224
     echo 'Copy it into a password manager or write it down somewhere.'
223
     echo ''
225
     echo ''
232
 # initial setup of the system
234
 # initial setup of the system
233
 if [ -f ~/.initial_setup ]; then
235
 if [ -f ~/.initial_setup ]; then
234
 EOF
236
 EOF
235
-    echo -n "    echo \"${MY_USERNAME}:" >> /root/.bashrc
236
-    echo -n '$(cat /home/'  >> /root/.bashrc
237
-    echo "${MY_USERNAME}/login.txt)\"|chpasswd" >> /root/.bashrc
237
+    echo -n "    echo \"${MY_USERNAME}:" >> $rootdir/root/.bashrc
238
+    echo -n '$(cat /home/'  >> $rootdir/root/.bashrc
239
+    echo "${MY_USERNAME}/login.txt)\"|chpasswd" >> $rootdir/root/.bashrc
238
     cat >> $rootdir/root/.bashrc <<EOF
240
     cat >> $rootdir/root/.bashrc <<EOF
239
     freedombone menuconfig
241
     freedombone menuconfig
240
     rm ~/.initial_setup
242
     rm ~/.initial_setup