Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
teevans committed Aug 4, 2022
1 parent b4fe868 commit cf74e39
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,33 @@ printf -- '======================================\n'
printf -- '\n'
printf -- 'Installing...'

{

# Create tmp file
rm -rf /tmp/pispotter
mkdir /tmp/pispotter
# Create tmp file
rm -rf /tmp/pispotter > /dev/null
mkdir /tmp/pispotter > /dev/null

# Download the compiled version of pi-spotter from releases
wget -O /tmp/pispotter/pispotter.zip https://github.com/teevans/pi-spotter/releases/latest/download/pispotter.zip
# Download the compiled version of pi-spotter from releases
wget -O /tmp/pispotter/pispotter.zip https://github.com/teevans/pi-spotter/releases/latest/download/pispotter.zip > /dev/null

# Extract the contents
unzip /tmp/pispotter/pispotter.zip -d /tmp/pispotter/
# Extract the contents
unzip /tmp/pispotter/pispotter.zip -d /tmp/pispotter/ > /dev/null

# Create the folder for nginx
rm -rf /var/www/pispotter
mkdir /var/www/pispotter
# Create the folder for nginx
rm -rf /var/www/pispotter
mkdir /var/www/pispotter

# Copy the contents to an nginx available folder
cp -r /tmp/pispotter/build/* /var/www/pispotter/
# Copy the contents to an nginx available folder
cp -r /tmp/pispotter/build/* /var/www/pispotter/

# Copy the pi-spotter nginx file to /etc/nginx/default.d/pispotter.conf
rm -f /etc/nginx/default.d/pispotter.conf
cp -r /tmp/pispotter/build/pispotter.conf /etc/nginx/default.d/
# Copy the pi-spotter nginx file to /etc/nginx/default.d/pispotter.conf
rm -f /etc/nginx/default.d/pispotter.conf
cp -r /tmp/pispotter/build/pispotter.conf /etc/nginx/default.d/

# Reload nginx
systemctl reload nginx
# Reload nginx
systemctl reload nginx

# Clean Up
rm -rf /tmp/pispotter


} > pispotter-install.log 2>&1
# Clean Up
rm -rf /tmp/pispotter

# Enable RO Filesystem
mount -o remount,ro /
Expand Down

0 comments on commit cf74e39

Please sign in to comment.