123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #!/usr/bin/env bash
- set -o errexit -o pipefail -o xtrace
- if [[ $LUKS_DECRYPT_WIN10 == FALSE ]]
- then
- :
- else
- if [[ -e /dev/lvm1/win10 ]]
- then
- :
- else
- sudo lvchange -ay /dev/lvm1/win10
- fi
- fi
- if [[ $LUKS_DECRYPT_NVME == FALSE ]]
- then
- :
- else
- if [[ -e /dev/mapper/crypt-nvme0n1 ]]
- then
- :
- else
- pass show luks2/luks2-header-210582390001289540AC \
- | sudo cryptsetup open \
- --allow-discards \
- --header="${HOME}/crypt/luks2-210582390001289540AC" \
- /dev/nvme0n1 \
- crypt-nvme0n1 \
- -
- fi
- if [[ -e /dev/lvm2/swap ]]
- then
- :
- else
- sudo lvchange -ay /dev/lvm2/swap
- sudo swapon /dev/lvm2/swap
- fi
- if [[ -e /dev/lvm2/ntfsgames ]]
- then
- :
- else
- sudo lvchange -ay /dev/lvm2/ntfsgames
- fi
- fi
- if [[ $LUKS_DECRYPT_QBITTORRENT == FALSE ]]
- then
- :
- else
- if [[ -e /dev/lvm2/qbittorrent-incomplete ]]
- then
- :
- else
- sudo lvchange -ay /dev/lvm2/qbittorrent-incomplete
- fi
- if mountpoint -q /mnt/qbittorrent-incomplete
- then
- :
- else
- sudo mount -o discard /dev/lvm2/qbittorrent-incomplete /mnt/qbittorrent-incomplete
- fi
- fi
- if [[ $LUKS_DECRYPT_HOME == FALSE ]]
- then
- :
- else
- subvols=(
- "archive"
- "phone"
- "src"
- "Maildir"
- )
- for subvol in "${subvols[@]}"
- do
- location="${HOME}/${subvol}"
- if mountpoint -q "$location"
- then
- :
- else
- sudo mount "$location"
- fi
- done
- fi
- if [[ $LUKS_DECRYPT_SRV == FALSE ]]
- then
- :
- else
- if [[ -e /dev/mapper/crypt-srv ]]
- then
- :
- else
- pass show luks2/luks2-header-wd-wd181purp-85b6hy0 \
- | sudo cryptsetup open \
- --header="${HOME}/crypt/luks2-wd181purp-85b6hy0" \
- /dev/sdb \
- crypt-srv \
- -
- fi
- if mountpoint -q /srv
- then
- :
- else
- sudo mount /srv
- fi
- fi
- # for kubelet
- if [[ -d /var/hpvolumes ]]
- then
- if mountpoint --quiet /var/hpvolumes
- then
- :
- else
- # Uncomment if '/var/hpvolumes' directory is on a '/' file-system.
- # mount --bind /var/hpvolumes /var/hpvolumes
- sudo mount /var/hpvolumes
- sudo mount --make-shared /var/hpvolumes
- fi
- fi
|