Add log functionality

This commit is contained in:
adrien 2021-01-25 14:56:42 +01:00
parent ea3ecc4a02
commit d3de9f36aa
2 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,12 @@ sudo curl -Lo /usr/local/sbin/bw-updater -sSf https://gitea.illuad.fr/adrien/bw-
sudo chmod 750 /usr/local/sbin/bw-updater
```
Create the logs' directory.
```
sudo mkdir -p /var/log/updater/bitwarden
```
## Configuration
This script requires the configuration of 3 variables to work: `key`, `chat_id` and `username`.

View File

@ -1,5 +1,11 @@
#! /usr/bin/env bash
# all executed commands are printed to stdout
set -x
# redirect stdout (and stderr to stdout) to a file
exec 1> /var/log/updater/bitwarden/bitwarden-$(date +%F).log 2>&1
# abort on nonzero exitstatus
set -o errexit