diff options
author | Ben Wolsieffer <benwolsieffer@gmail.com> | 2018-10-11 15:52:11 -0400 |
---|---|---|
committer | Ben Wolsieffer <benwolsieffer@gmail.com> | 2018-10-11 15:53:53 -0400 |
commit | 264cb7407c9274e6b3fe9e5d6f112f399ae91090 (patch) | |
tree | 5567c1647fb4b3772ac01de10abac1c3a4699880 /nixos/modules/system/boot/luksroot.nix | |
parent | dd428b8f5f5a4790f16aa2377a38a72297ed3249 (diff) | |
download | nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.tar nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.tar.gz nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.tar.bz2 nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.tar.lz nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.tar.xz nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.tar.zst nixpkgs-264cb7407c9274e6b3fe9e5d6f112f399ae91090.zip |
nixos: initrd/luks: make script indentation consistent
Diffstat (limited to 'nixos/modules/system/boot/luksroot.nix')
-rw-r--r-- | nixos/modules/system/boot/luksroot.nix | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index 1079089bc5a..1b153f2132b 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -7,19 +7,19 @@ let commonFunctions = '' die() { - echo "$@" >&2 - exit 1 + echo "$@" >&2 + exit 1 } dev_exist() { - local target="$1" - if [ -e $target ]; then - return 0 - else - local uuid=$(echo -n $target | sed -e 's,UUID=\(.*\),\1,g') - local dev=$(blkid --uuid $uuid) - return $? - fi + local target="$1" + if [ -e $target ]; then + return 0 + else + local uuid=$(echo -n $target | sed -e 's,UUID=\(.*\),\1,g') + local dev=$(blkid --uuid $uuid) + return $? + fi } wait_target() { @@ -51,30 +51,30 @@ let } wait_yubikey() { - local secs="''${1:-10}" - - ykinfo -v 1>/dev/null 2>&1 - if [ $? != 0 ]; then - echo -n "Waiting $secs seconds for Yubikey to appear..." - local success=false - for try in $(seq $secs); do - echo -n . - sleep 1 - ykinfo -v 1>/dev/null 2>&1 - if [ $? == 0 ]; then - success=true - break - fi - done - if [ $success == true ]; then - echo " - success"; - return 0 - else - echo " - failure"; - return 1 - fi - fi - return 0 + local secs="''${1:-10}" + + ykinfo -v 1>/dev/null 2>&1 + if [ $? != 0 ]; then + echo -n "Waiting $secs seconds for Yubikey to appear..." + local success=false + for try in $(seq $secs); do + echo -n . + sleep 1 + ykinfo -v 1>/dev/null 2>&1 + if [ $? == 0 ]; then + success=true + break + fi + done + if [ $success == true ]; then + echo " - success"; + return 0 + else + echo " - failure"; + return 1 + fi + fi + return 0 } ''; |