diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-03-05 16:17:56 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-03-05 16:17:56 +0100 |
commit | 4a9da3960914df0aef1217790b6dbc01d6b02220 (patch) | |
tree | e545b69e3a5ab02509e25c655f9f402d0c932cc6 /src | |
parent | add .gitattributes (diff) | |
download | audit-scripts-4a9da3960914df0aef1217790b6dbc01d6b02220.tar.gz audit-scripts-4a9da3960914df0aef1217790b6dbc01d6b02220.zip |
add some Ubuntu scripts
Diffstat (limited to '')
-rwxr-xr-x | src/ubuntu/check-package-integrity.sh | 11 | ||||
-rwxr-xr-x | src/ubuntu/unmanaged-files.sh | 31 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/ubuntu/check-package-integrity.sh b/src/ubuntu/check-package-integrity.sh new file mode 100755 index 0000000..39e01dd --- /dev/null +++ b/src/ubuntu/check-package-integrity.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +shopt -s inherit_errexit lastpipe + +if ! command -v debsums &> /dev/null; then + echo 'Where is debsums?' >&2 + exit 1 +fi + +debsums -ca diff --git a/src/ubuntu/unmanaged-files.sh b/src/ubuntu/unmanaged-files.sh new file mode 100755 index 0000000..88514a0 --- /dev/null +++ b/src/ubuntu/unmanaged-files.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +shopt -s inherit_errexit lastpipe + +if ! command -v cruft &> /dev/null; then + echo 'Where is cruft?' >&2 + exit 1 +fi + +ignored_dirs=( + /boot + /etc/letsencrypt + /home + /snap + /srv + /tmp + /var/lib/docker + /var/lib/i2pd + /var/lib/snapd + /var/lib/tor + /var/log +) + +args=() + +for dir in ${ignored_dirs[@]+"${ignored_dirs[@]}"}; do + args+=(--ignore "$dir") +done + +cruft ${args[@]+"${args[@]}"} |