diff --git a/scripts/bitwarden.ps1 b/scripts/bitwarden.ps1 index 223859f98..4ec76df96 100644 --- a/scripts/bitwarden.ps1 +++ b/scripts/bitwarden.ps1 @@ -1,7 +1,8 @@ param ( [switch] $install, [switch] $run, - [switch] $restart, + [switch] $restart + [switch] $stop, [switch] $update, [switch] $updatedb, [string] $output = "" @@ -40,6 +41,7 @@ if(!(Test-Path -Path $scriptsDir)) { function Download-Run-Files { Invoke-RestMethod -OutFile $scriptsDir\run.ps1 -Uri "${githubBaseUrl}/scripts/run.ps1" + Invoke-RestMethod -OutFile $scriptsDir\stop.ps1 -Uri "${githubBaseUrl}/scripts/stop.ps1" Invoke-RestMethod -OutFile $dockerDir\docker-compose.yml -Uri "${githubBaseUrl}/docker/docker-compose.yml" Invoke-RestMethod -OutFile $dockerDir\docker-compose.macwin.yml ` -Uri "${githubBaseUrl}/docker/docker-compose.macwin.yml" Invoke-RestMethod -OutFile $dockerDir\global.env -Uri "${githubBaseUrl}/docker/global.env" @@ -71,6 +73,9 @@ elseif($updatedb) { Invoke-RestMethod -OutFile $scriptsDir\update-db.ps1 -Uri "${githubBaseUrl}/scripts/update-db.ps1" Invoke-Expression "$scriptsDir\update-db.ps1 -outputDir $output" } +elseif($stop) { + Invoke-Expression "$scriptsDir\stop.ps1 -dockerDir $dockerDir" +} else { echo "No command found." } diff --git a/scripts/bitwarden.sh b/scripts/bitwarden.sh index 15455cb83..495d5696f 100755 --- a/scripts/bitwarden.sh +++ b/scripts/bitwarden.sh @@ -47,6 +47,8 @@ fi function downloadRunFiles() { curl -s -o $SCRIPTS_DIR/run.sh $GITHUB_BASE_URL/scripts/run.sh chmod u+x $SCRIPTS_DIR/run.sh + curl -s -o $SCRIPTS_DIR/stop.sh $GITHUB_BASE_URL/scripts/stop.sh + chmod u+x $SCRIPTS_DIR/stop.sh curl -s -o $DOCKER_DIR/docker-compose.yml $GITHUB_BASE_URL/docker/docker-compose.yml curl -s -o $DOCKER_DIR/docker-compose.$OS.yml $GITHUB_BASE_URL/docker/docker-compose.$OS.yml curl -s -o $DOCKER_DIR/global.env $GITHUB_BASE_URL/docker/global.env @@ -81,6 +83,9 @@ then curl -s -o $SCRIPTS_DIR/update-db.sh $GITHUB_BASE_URL/scripts/update-db.sh chmod u+x $SCRIPTS_DIR/update-db.sh $SCRIPTS_DIR/update-db.sh $OUTPUT +elif [ "$1" == "stop" ] +then + $SCRIPTS_DIR/stop.sh $DOCKER_DIR else echo "No command found." fi diff --git a/scripts/stop.ps1 b/scripts/stop.ps1 new file mode 100644 index 000000000..29ab436f6 --- /dev/null +++ b/scripts/stop.ps1 @@ -0,0 +1,13 @@ +param ( + [string] $dockerDir = "" +) + +$dir = Split-Path -Parent $MyInvocation.MyCommand.Path +if($dockerDir -eq "") { + $dockerDir="${dir}\..\docker" +} + +docker --version +docker-compose --version + +docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.macwin.yml down diff --git a/scripts/stop.sh b/scripts/stop.sh new file mode 100644 index 000000000..c85c09ca5 --- /dev/null +++ b/scripts/stop.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DOCKER_DIR=$DIR/../docker +if [ $# -eq 1 ] +then + DOCKER_DIR=$1 +fi + +OS="linux" +if [ "$(uname)" == "Darwin" ] +then + OS="macwin" +fi + +docker --version +docker-compose --version + +docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.$OS.yml down diff --git a/util/Setup/Program.cs b/util/Setup/Program.cs index 74811fcf7..faedf1dcc 100644 --- a/util/Setup/Program.cs +++ b/util/Setup/Program.cs @@ -81,6 +81,7 @@ namespace Setup BuildEnvironmentFiles(); BuildAppSettingsFiles(); + BuildAppId(); } private static void Update()