Skip to content

Commit

Permalink
Split each install function into a separate file.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Nov 19, 2024
1 parent 76593df commit 890822a
Show file tree
Hide file tree
Showing 11 changed files with 241 additions and 307 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ folks even report that it works on a Mac.
To install POCS via the script, open a terminal and enter (you may be prompted for your `sudo` password):

```bash
curl -fsSL https://install.projectpanoptes.org > install-pocs.sh
bash install-pocs.sh
curl -fsSL https://install.projectpanoptes.org > install.sh
bash install.sh
```

Or using `wget`:

```bash
wget -qO- https://install.projectpanoptes.org > install-pocs.sh
bash install-pocs.sh
wget -qO- https://install.projectpanoptes.org > install.sh
bash install.sh
```

The install script will ask a few questions at the beginning of the process. If you are unsure of
Expand Down
25 changes: 25 additions & 0 deletions resources/arduino/install-arduino-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# Check for arduino-cli tool first.
if command -v arduino-cli &> /dev/null; then
echo "arduino-cli is already installed."
exit 0
fi

# Make sure we are at home.
cd

# Get the arduino-cli tool and install.
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh

"${HOME}/bin/arduino-cli" config init
"${HOME}/bin/arduino-cli" core update-index
"${HOME}/bin/arduino-cli" core install arduino:avr
"${HOME}/bin/arduino-cli" lib install ArduinoJson

# Ask if the user wants to install the power board software.
read -p "Do you want to install the power board software? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
source ./install-power-board.sh
fi
303 changes: 0 additions & 303 deletions resources/install-pocs.sh

This file was deleted.

27 changes: 27 additions & 0 deletions resources/scripts/fix-time.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# We use htpdate below so this just needs to be a public url w/ trusted time.
TIME_SERVER="${TIME_SERVER:-google.com}"

function fix_time() {
echo "Syncing time."
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y -qq htpdate
sudo timedatectl set-ntp false
sudo /usr/sbin/htpdate -as "${TIME_SERVER}"
sudo timedatectl set-ntp true

# Add crontab entries for reboot and every hour.
(
sudo crontab -l
echo "@reboot /usr/sbin/htpdate -as ${TIME_SERVER}"
) | sudo crontab -
(
sudo crontab -l
echo "13 * * * * /usr/sbin/htpdate -s ${TIME_SERVER}"
) | sudo crontab -

# Show updated time.
timedatectl
}

fix_time
Loading

0 comments on commit 890822a

Please sign in to comment.