2 # Copyright (C) 2019 Ian Kelling
3 # SPDX-License-Identifier: AGPL-3.0-or-later
6 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
8 [[ $EUID == 0 ]] ||
exec sudo
-E "${BASH_SOURCE[0]}" "$@"
9 if [[ $
- != *i
* ]]; then
10 exec &>/var
/log
/keyscript-off.log
11 echo "$0: starting. $(date)"
13 sed="sed --follow-symlinks"
15 if [[ $
($sed -rn 's/^ID=(.*)/\1/p' /etc
/os-release
) == arch
]]; then
16 if grep -q '^\s*FILES=' /etc
/mkinitcpio.conf
; then
17 $sed -ri 's/^\s*FILES=/#\0/' /etc
/mkinitcpio.conf
# comment out
22 if grep -q "${x}," /etc
/crypttab
; then
23 $sed -i "s#${x},#decrypt_keyctl,#" /etc
/crypttab
28 # switch to easy or hard pass which is the same as luks
29 f
=/q
/root
/shadow
/traci
30 [[ $HOSTNAME != tpnew
]] || usermod
-p "$(cat $f)" iank
31 echo "$0: finished. $(date)"