Skip to content

Commit

Permalink
docker: allow root install
Browse files Browse the repository at this point in the history
  • Loading branch information
koush authored Dec 23, 2023
1 parent 8874e01 commit 79286a5
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions install/docker/install-scrypted-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@ then
exit 0
fi

if [ "$SERVICE_USER" == "root" ]
then
echo "Scrypted SERVICE_USER root is not allowed."
exit 1
fi

USER_HOME=$(eval echo ~$SERVICE_USER)
SCRYPTED_HOME=$USER_HOME/.scrypted
mkdir -p $SCRYPTED_HOME

set -e
cd $SCRYPTED_HOME

function readyn() {
while true; do
read -p "$1 (y/n) " yn
Expand All @@ -30,6 +17,22 @@ function readyn() {
done
}

if [ "$SERVICE_USER" == "root" ]
then
readyn "Scrypted will store its files in the root user home directory. Running as a non-root user is recommended. Are you sure?"
if [ "$yn" == "n" ]
then
exit 1
fi
fi

USER_HOME=$(eval echo ~$SERVICE_USER)
SCRYPTED_HOME=$USER_HOME/.scrypted
mkdir -p $SCRYPTED_HOME

set -e
cd $SCRYPTED_HOME

readyn "Install Docker?"

if [ "$yn" == "y" ]
Expand Down

0 comments on commit 79286a5

Please sign in to comment.