From d38938b90f1a07f721dc4559b10dc3a48caa8493 Mon Sep 17 00:00:00 2001 From: raiha <68338762+raihalea@users.noreply.github.com> Date: Wed, 2 Oct 2024 23:56:31 +0900 Subject: [PATCH 1/2] Add --skip-create-user option --- contrib/deploy_timesketch.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/contrib/deploy_timesketch.sh b/contrib/deploy_timesketch.sh index cb2f6245fb..d7b7e6e63f 100755 --- a/contrib/deploy_timesketch.sh +++ b/contrib/deploy_timesketch.sh @@ -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 @@ -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] (default:no)" CREATE_USER +fi if [ "$CREATE_USER" != "${CREATE_USER#[Yy]}" ] ;then read -p "Please provide a new username: " NEWUSERNAME From 4ebc401c5001e8a6fee8d161299301a499ee19d9 Mon Sep 17 00:00:00 2001 From: Janosch <99879757+jkppr@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:29:42 +0200 Subject: [PATCH 2/2] Update deploy_timesketch.sh --- contrib/deploy_timesketch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/deploy_timesketch.sh b/contrib/deploy_timesketch.sh index d7b7e6e63f..978d14b27a 100755 --- a/contrib/deploy_timesketch.sh +++ b/contrib/deploy_timesketch.sh @@ -157,7 +157,7 @@ else fi if [ -z "$SKIP_CREATE_USER" ]; then - read -p "Would you like to create a new timesketch user? [Y/n] (default:no)" CREATE_USER + read -p "Would you like to create a new timesketch user? [y/N]" CREATE_USER fi if [ "$CREATE_USER" != "${CREATE_USER#[Yy]}" ] ;then