aboutsummaryrefslogtreecommitdiff
path: root/bin/executable_wd-mount
blob: de4703fd20840b20a450e479f3345e87f6bc2450 (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
32
#!/bin/sh

case `uname` in
    OpenBSD)
        doas bioctl -c C -l fe3fd8d53b06049b.a softraid0
        doas mount /media/wd
        ;;
    Linux)
        if ! mount | grep -w /media/t > /dev/null ; then
            if [ -e /dev/disk/by-uuid/0c5bcd92-bf08-4a21-a117-0ba9c0c31862 ]; then
                sudo cryptdisks_start tosh && \
                    sudo zpool import ztosh && \
                    sudo mount /var/lib/mpd/music
                sudo vgimport tosh
                sudo vgchange -ay tosh
            fi
        fi

        if ! mount | grep -w /media/wd-bak > /dev/null ; then
            if [ -e /dev/disk/by-uuid/68b52a2b-2be5-4d40-98ba-c8469da50f1f ]; then
                sudo cryptdisks_start wd-bak-work && mount /dev/mapper/wd-bak-work
            elif [ -e /dev/disk/by-uuid/49491f12-45ec-4f3f-9f70-73a94149aaf2 ]; then
                sudo cryptdisks_start wd-bak && mount /dev/mapper/wd-bak
            fi
        fi
        ;;
    *)
        echo "Unknown host"
        exit 1
esac

# vim: set sw=4: