aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ubuntu/unmanaged.sh
blob: 88514a0f4be90de146bd2042f2c521ccfa8cfeb1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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[@]}"}