From c05ac5d14afbe70b46bd59f278395533837d59c9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 5 Mar 2023 16:39:13 +0100 Subject: rename Ubuntu scripts --- README.md | 18 ++++++++++++++++++ src/ubuntu/check-integrity.sh | 11 +++++++++++ src/ubuntu/check-package-integrity.sh | 11 ----------- src/ubuntu/unmanaged-files.sh | 31 ------------------------------- src/ubuntu/unmanaged.sh | 31 +++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 42 deletions(-) create mode 100755 src/ubuntu/check-integrity.sh delete mode 100755 src/ubuntu/check-package-integrity.sh delete mode 100755 src/ubuntu/unmanaged-files.sh create mode 100755 src/ubuntu/unmanaged.sh diff --git a/README.md b/README.md index 3527730..262ee36 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,24 @@ Which directories are writable by a user? ./src/writable-dirs -u USERNAME / +Ubuntu +------ + +Ubuntu-specific (or Debian-specific) scripts. + +### check-integrity.sh + +Use `debsums` to verify file integrity against the package database. + + ./src/ubuntu/check-integrity.sh + +### unmanaged.sh + +Use `cruft` to view a list of unmanaged files and directories. +Some common directories are excluded automatically. + + ./src/ubuntu/unmanaged.sh + License ------- diff --git a/src/ubuntu/check-integrity.sh b/src/ubuntu/check-integrity.sh new file mode 100755 index 0000000..39e01dd --- /dev/null +++ b/src/ubuntu/check-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/check-package-integrity.sh b/src/ubuntu/check-package-integrity.sh deleted file mode 100755 index 39e01dd..0000000 --- a/src/ubuntu/check-package-integrity.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/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 deleted file mode 100755 index 88514a0..0000000 --- a/src/ubuntu/unmanaged-files.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/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[@]}"} diff --git a/src/ubuntu/unmanaged.sh b/src/ubuntu/unmanaged.sh new file mode 100755 index 0000000..88514a0 --- /dev/null +++ b/src/ubuntu/unmanaged.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[@]}"} -- cgit v1.2.3