diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index e0bd6136..dfc26909 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -237,6 +237,11 @@ EOF echo ' if [ -f ~/login.txt ]; then' >> $rootdir/root/.bashrc echo ' NEW_USER_PASSWORD=$(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 + echo ' echo "WARNING: The entropy available on this system is too low to generate a password"' >> $rootdir/root/.bashrc + echo ' exit 5763' >> $rootdir/root/.bashrc + echo ' fi' >> $rootdir/root/.bashrc echo ' NEW_USER_PASSWORD="$(openssl rand -base64 12 | cut -c1-10)"' >> $rootdir/root/.bashrc echo ' fi' >> $rootdir/root/.bashrc echo ' echo -n "${NEW_USER_PASSWORD}" > ~/login.txt' >> $rootdir/root/.bashrc