install: ensure local/docker services cant run concurrently

This commit is contained in:
Koushik Dutta
2024-01-29 18:21:14 -08:00
parent 4b6a858f2b
commit 62cbb88207
2 changed files with 11 additions and 0 deletions

View File

@@ -26,6 +26,10 @@ then
fi
fi
echo "Stopping local service if it is running..."
systemctl stop scrypted.service 2> /dev/null
systemctl disable scrypted.service 2> /dev/null
USER_HOME=$(eval echo ~$SERVICE_USER)
SCRYPTED_HOME=$USER_HOME/.scrypted
mkdir -p $SCRYPTED_HOME

View File

@@ -89,6 +89,13 @@ USER_HOME=$(eval echo ~$SERVICE_USER)
echo "Setting permissions on $USER_HOME/.scrypted"
chown -R $SERVICE_USER $USER_HOME/.scrypted
echo "Stopping docker service if it exists..."
cd $USER_HOME/.scrypted
echo "docker compose down"
sudo -u $SERVICE_USER docker compose down 2> /dev/null
echo "docker compose rm -rf"
sudo -u $SERVICE_USER docker rm -f /scrypted /scrypted-watchtower 2> /dev/null
echo "Installing Scrypted..."
RUN sudo -u $SERVICE_USER npx -y scrypted@latest install-server