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

Add --skip-create-user option to enable non-interactive deployments #3194

Merged
merged 3 commits into from
Oct 7, 2024
Merged
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
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
Loading