Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-12-09 install.sh - master branch #783

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# version - MUST be exactly 7 characters!
UPDATE="2024v02"
UPDATE="2024v03"

echo " "
echo " _____ ____ _______ _ installer _ "
Expand Down Expand Up @@ -335,7 +335,6 @@ if [ ! -d "$IOTSTACK" ] ; then
fi
if [ $? -eq 0 -a -d "$IOTSTACK" ] ; then
echo "IOTstack cloned successfully into $IOTSTACK"
mkdir -p "$IOTSTACK/backups" "$IOTSTACK/services"
else
echo "Unable to clone IOTstack (likely a git or network error)"
handle_exit 1
Expand All @@ -344,6 +343,13 @@ else
echo -e "\n$IOTSTACK already exists - no need to clone from GitHub"
fi

# ensure backups and services directories exist and are owned by $USER
# https://github.com/SensorsIot/IOTstack/issues/651#issuecomment-2525347511
mkdir -p "$IOTSTACK/backups" "$IOTSTACK/services"
sudo chown -R "$USER:$USER" "$IOTSTACK/backups" "$IOTSTACK/services"
# but, if the influxdb backup dir already exists, put it back to root
[ -d "$IOTSTACK/backups/influxdb" ] && sudo chown -R "root:root" "$IOTSTACK/backups/influxdb"

# initialise docker-compose global environment file with system timezone
if [ ! -f "$IOTSTACK_ENV" ] || [ $(grep -c "^TZ=" "$IOTSTACK_ENV") -eq 0 ] ; then
echo "TZ=$(cat /etc/timezone)" >>"$IOTSTACK_ENV"
Expand Down