Skip to content

Commit

Permalink
Add --skip-create-user option to enable non-interactive deployments (#…
Browse files Browse the repository at this point in the history
…3194)

* Add --skip-create-user option

---------

Co-authored-by: Janosch <[email protected]>
  • Loading branch information
raihalea and jkppr authored Oct 7, 2024
1 parent d34afff commit 18998e1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions contrib/deploy_timesketch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@
set -e

START_CONTAINER=
SKIP_CREATE_USER=

if [ "$1" == "--start-container" ]; then
START_CONTAINER=yes
fi
while [[ "$#" -gt 0 ]]; do
case $1 in
--start-container) START_CONTAINER=yes ;;
--skip-create-user) SKIP_CREATE_USER=yes ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done

# Exit early if run as non-root user.
if [ "$EUID" -ne 0 ]; then
Expand Down Expand Up @@ -150,7 +156,9 @@ else
exit
fi

read -p "Would you like to create a new timesketch user? [Y/n] (default:no)" CREATE_USER
if [ -z "$SKIP_CREATE_USER" ]; then
read -p "Would you like to create a new timesketch user? [y/N]" CREATE_USER
fi

if [ "$CREATE_USER" != "${CREATE_USER#[Yy]}" ] ;then
read -p "Please provide a new username: " NEWUSERNAME
Expand Down

0 comments on commit 18998e1

Please sign in to comment.