Check that the initial setup really did complete

This commit is contained in:
Bob Mottram 2017-06-02 11:53:22 +01:00
parent 8ca47c2c30
commit b277b5e570
1 changed files with 30 additions and 27 deletions

View File

@ -407,38 +407,41 @@ EOF
fi
echo ' if [ "$?" = "0" ]; then' >> $rootdir/root/.bashrc
echo " if [ -f ~/${PROJECT_NAME}-completed.txt ]; then" >> $rootdir/root/.bashrc
echo " # Check that the initial setup really did complete" >> $rootdir/root/.bashrc
echo " if grep -q 'tripwire' ~/${PROJECT_NAME}-completed.txt; then" >> $rootdir/root/.bashrc
# Remove the initial setup files
echo ' rm /root/.initial_setup' >> $rootdir/root/.bashrc
echo ' rm /home/fbone/.initial_setup' >> $rootdir/root/.bashrc
echo " touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc
echo ' shred -zu ~/login.txt' >> $rootdir/root/.bashrc
echo ' rm /root/.initial_setup' >> $rootdir/root/.bashrc
echo ' rm /home/fbone/.initial_setup' >> $rootdir/root/.bashrc
echo " touch /root/.remove_${GENERIC_IMAGE_USERNAME}" >> $rootdir/root/.bashrc
echo ' shred -zu ~/login.txt' >> $rootdir/root/.bashrc
if [[ $VARIANT != "mesh" && $VARIANT != "meshclient" && $VARIANT != "meshusb" && $VARIANT != "usb" ]]; then
echo ' SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc
echo ' SSH_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_ssh/hostname)' >> $rootdir/root/.bashrc
echo ' if [ ${#SSH_ONION_HOSTNAME} -lt 2 ]; then' >> $rootdir/root/.bashrc
echo ' exit 62392' >> $rootdir/root/.bashrc
echo ' fi' >> $rootdir/root/.bashrc
echo ' if [ ${#SSH_ONION_HOSTNAME} -lt 2 ]; then' >> $rootdir/root/.bashrc
echo ' exit 62392' >> $rootdir/root/.bashrc
echo ' fi' >> $rootdir/root/.bashrc
fi
echo " if [ -f /root/${PROJECT_NAME}-wifi.cfg ]; then" >> $rootdir/root/.bashrc
echo " echo '[Unit]' > /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'Description=WifiStartup (Start wifi networking)' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'After=syslog.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'After=network.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'After=remote-fs.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '[Service]' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'Type=simple' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'User=root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'Group=root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'WorkingDirectory=/root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'ExecStart=/usr/local/bin/freedombone-wifi --wait 5 2> /dev/null' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '[Install]' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'WantedBy=multi-user.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " systemctl enable wifistart" >> $rootdir/root/.bashrc
echo " systemctl daemon-reload" >> $rootdir/root/.bashrc
echo " if [ -f /root/${PROJECT_NAME}-wifi.cfg ]; then" >> $rootdir/root/.bashrc
echo " echo '[Unit]' > /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'Description=WifiStartup (Start wifi networking)' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'After=syslog.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'After=network.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'After=remote-fs.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '[Service]' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'Type=simple' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'User=root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'Group=root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'WorkingDirectory=/root' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'ExecStart=/usr/local/bin/freedombone-wifi --wait 5 2> /dev/null' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo '[Install]' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " echo 'WantedBy=multi-user.target' >> /etc/systemd/system/wifistart.service" >> $rootdir/root/.bashrc
echo " systemctl enable wifistart" >> $rootdir/root/.bashrc
echo " systemctl daemon-reload" >> $rootdir/root/.bashrc
echo ' fi' >> $rootdir/root/.bashrc
echo ' reboot' >> $rootdir/root/.bashrc
echo ' fi' >> $rootdir/root/.bashrc
echo ' reboot' >> $rootdir/root/.bashrc
echo ' fi' >> $rootdir/root/.bashrc
echo ' else' >> $rootdir/root/.bashrc
echo ' key=' >> $rootdir/root/.bashrc