Skip to content

Commit

Permalink
Merge pull request #697 from thomasjacquin/website-install.sh-inform-…
Browse files Browse the repository at this point in the history
…user

website/install.sh: Inform user what to do
  • Loading branch information
linuxkidd authored Oct 20, 2021
2 parents cfd3980 + 5dbca99 commit aa4417b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
6 changes: 6 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash

if [ -z "${ALLSKY_HOME}" ]
then
export ALLSKY_HOME="$(realpath $(dirname "${BASH_ARGV0}"))"
fi

source "variables.sh"
if [[ $EUID -eq 0 ]]; then
echo "This script must NOT be run as root" 1>&2
Expand Down
50 changes: 33 additions & 17 deletions website/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,44 @@
if [ -z "${ALLSKY_HOME}" ] ; then
export ALLSKY_HOME=$(realpath $(dirname "${BASH_ARGV0}")/..)
fi
source ${ALLSKY_HOME}/variables.sh
source "${ALLSKY_HOME}/variables.sh"
source "${ALLSKY_CONFIG}/config.sh"

echo -en '\n'
echo -e "*************************************"
echo "*** Welcome to the Allsky Website ***"
echo -e "*************************************"
echo -en '\n'
echo
echo "*************************************"
echo "*** Welcome to the Allsky Website ***"
echo "*************************************"
echo

echo -en "${GREEN}* Fetching website files\n${NC}"
echo -e "${GREEN}* Fetching website files into ${WEBSITE_DIR}${NC}"
git clone https://github.com/thomasjacquin/allsky-website.git "${WEBSITE_DIR}"
echo -en '\n'
echo

cd "${WEBSITE_DIR}"

# xxxx Should set some variables in config.js based on settings_*.json and config.sh
# If the directories already exist, don't mess with them.
if [ ! -d startrails/thumbnails -o ! -d keograms/thumbnails -o ! -d videos/thumbnails ]; then
echo -e "${GREEN}* Creating thumbnails directories${NC}"
mkdir -p startrails/thumbnails keograms/thumbnails videos/thumbnails
echo

echo -en "${GREEN}* Creating thumbnails directories\n${NC}"
mkdir startrails/thumbnails keograms/thumbnails videos/thumbnails
echo -en '\n'
echo -e "${GREEN}* Fixing ownership and permissions${NC}"
chown -R pi:www-data .
find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 775 {} \;
echo
fi

# xxxx Should set some variables in config.js based on settings_*.json and config.sh.
# In the meantime, let the user know to do it.
echo
echo -e "${GREEN}* Installation complete${NC}"
echo

echo -en "${GREEN}* Fixing ownership and permissions\n${NC}"
chown -R pi:www-data .
find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 775 {} \;
echo -en '\n'
echo "+++++++++++++++++++++++++++++++++++++"
echo "Before using the website you need to:"
echo " * Edit '${WEBSITE_DIR}/config.js'"
if [ "x${POST_END_OF_NIGHT_DATA}" != "xtrue" ]; then
echo " * Set 'POST_END_OF_NIGHT_DATA=true' in ${ALLSKY_CONFIG}/config.sh"
fi
echo

0 comments on commit aa4417b

Please sign in to comment.