diff options
author | EuAndreh <eu@euandre.org> | 2024-08-18 18:26:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-08-18 18:26:58 -0300 |
commit | 5cabb11e012365096bea22bbb5014dd031537c42 (patch) | |
tree | 6b5b108fe996f6ae54f32b2fbcdc065b71baac55 /src/infrastructure/scripts/check.sh | |
parent | system.scm: Use configuration from syskeep and upstream "packages" repository (diff) | |
download | toph-5cabb11e012365096bea22bbb5014dd031537c42.tar.gz toph-5cabb11e012365096bea22bbb5014dd031537c42.tar.xz |
rm -rf src/infrastructure/{ci,config,scripts}/
Diffstat (limited to 'src/infrastructure/scripts/check.sh')
-rwxr-xr-x | src/infrastructure/scripts/check.sh | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/infrastructure/scripts/check.sh b/src/infrastructure/scripts/check.sh deleted file mode 100755 index 5c63816..0000000 --- a/src/infrastructure/scripts/check.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - check - check -h - EOF -} - -help() { - cat <<-'EOF' - - - Options: - -h, --help show this message - - - Run system sanity checks, such as email reachability, alarms - reachability, filesystem checks, etc. - - - Examples: - - Just run it - - $ check - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -if [ "$(id -un)" != 'root' ]; then - printf 'This script must be run as root.\n\n' >&2 - usage >&2 - exit 2 -fi - - -uuid() { - od -xN20 /dev/urandom | - head -n1 | - awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' -} - -for alias in abuse admin postmaster hostmaster; do - uuid | mail -s "\"$alias\" alias test from $(id -un)@$(hostname)" "$alias@$(hostname)" -done - - -PARTITIONS=' -/dev/vda3 -/dev/vdb1 -/dev/vdc1 -' -set -x - -for part in $PARTITIONS; do - btrfs scrub start -B "$part" - btrfs check --force -p "$part" -done |