Skip to content

Commit

Permalink
Initial save
Browse files Browse the repository at this point in the history
This file is executed by rc.local on the Pi ISO release.
  • Loading branch information
Ben committed Dec 2, 2018
1 parent 3ba4284 commit 0d07da7
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

.DS_Store

.DS_Store
update-addresses.sh
install
init.sh
72 changes: 72 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Let's wait 1 full minute for services to start and network card initializations to finish.

printf "\n\n\n\n\n\n\n\nLynxCI initialization will start in 60 seconds.\n\n\n\n\n\n"

sleep 60

# Ping Google NS server to test public network access

if /bin/ping -c 1 8.8.8.8 &> /dev/null
then

# Remove the file if it already exists from a previous try.

rm -rf /root/setup.sh

# Grab the remote file. If it failes for any reason, reboot.

if /usr/bin/wget -O /root/setup.sh https://getlynx.io/setup.sh; then

# File exists and is a regular file. A regular file is neither a block or character special file nor a directory.

if [ -f "/root/setup.sh" ]; then

# File exists and has a size of more than 0 bytes.

if [ -s "/root/setup.sh" ]; then

/bin/chmod 700 /root/setup.sh

/root/setup.sh

else

echo "Downloaded setup script was corrupted (-s). Rebooting and will try again."

sleep 30

reboot

fi

else

echo "Downloaded setup script was corrupted (-f). Rebooting and will try again."

sleep 30

reboot

fi

else

echo "Failed to download setup script. Rebooting and will try again."

sleep 30

reboot

fi

else

echo "No public network access detected. If using wifi, verify your /boot/wpa_supplicant.conf file is set up properly. Rebooting and will try again."

sleep 60

reboot

fi

0 comments on commit 0d07da7

Please sign in to comment.