Add log functionality
This commit is contained in:
parent
ea3ecc4a02
commit
d3de9f36aa
@ -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
|
sudo chmod 750 /usr/local/sbin/bw-updater
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Create the logs' directory.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo mkdir -p /var/log/updater/bitwarden
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
This script requires the configuration of 3 variables to work: `key`, `chat_id` and `username`.
|
This script requires the configuration of 3 variables to work: `key`, `chat_id` and `username`.
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
#! /usr/bin/env bash
|
#! /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
|
# abort on nonzero exitstatus
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user