aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-08-06 19:17:20 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-08-06 22:40:32 +0200
commita1f719112f02feb8e7c854a5095c7cebb6d0bf4a (patch)
treef029b41b020ee7da4a9b44c553349d9b4e8cd746 /defaults/login-remote.sh
parentlinuxrc: Fix console support (diff)
downloadgenkernel-a1f719112f02feb8e7c854a5095c7cebb6d0bf4a.tar.gz
genkernel-a1f719112f02feb8e7c854a5095c7cebb6d0bf4a.tar.bz2
genkernel-a1f719112f02feb8e7c854a5095c7cebb6d0bf4a.zip
login-remote.sh: Make shellcheck happy
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'defaults/login-remote.sh')
-rw-r--r--defaults/login-remote.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/defaults/login-remote.sh b/defaults/login-remote.sh
index ca85b06b..12596b9d 100644
--- a/defaults/login-remote.sh
+++ b/defaults/login-remote.sh
@@ -15,31 +15,31 @@ receivefile() {
swap)
file=${CRYPT_KEYFILE_SWAP}
;;
+ '')
+ bad_msg "No keyfile specified." "${CRYPT_SILENT}"
+ exit 1
+ ;;
*)
- bad_msg "Unknown '${1}' keyfile received." ${CRYPT_SILENT}
+ bad_msg "Unknown '${1}' keyfile received." "${CRYPT_SILENT}"
exit 1
;;
esac
# limit maximum stored bytes to 1M to avoid killing the server
- dd of=${file} count=1k bs=1k 2>/dev/null
+ run dd of="${file}" count=1k bs=1k 2>/dev/null
return $?
}
-
-
if [ "x${1}" = "x-c" ]
then
- command=$(echo ${2} | awk -F" " '{print $1}')
- type=$(echo ${2} | awk -F" " '{print $2}')
+ command=$(echo "${2}" | awk '{ print $1 }')
+ type=$(echo "${2}" | awk '{ print $2 }')
case ${command} in
post)
- receivefile ${type}
- if [ $? -eq 0 ]
+ if receivefile "${type}"
then
- unlock-luks ${type}
- if [ $? -eq 0 ]
+ if unlock-luks "${type}"
then
if [ "${type}" = 'root' ]
then
@@ -53,12 +53,12 @@ then
exit 1
fi
else
- bad_msg "Keyfile was not properly received!" ${CRYPT_SILENT}
+ bad_msg "Keyfile was not properly received!" "${CRYPT_SILENT}"
exit 1
fi
;;
*)
- bad_msg "Command '${command}' is not supported!" ${CRYPT_SILENT}
+ bad_msg "Command '${command}' is not supported!" "${CRYPT_SILENT}"
exit 1
esac
else
@@ -77,12 +77,12 @@ else
good_msg "${NORMAL}Be aware that it will kill your connection which means"
good_msg "${NORMAL}you will no longer be able to work in this shell."
- if [ -n "${CRYPT_ROOT}" -a ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ]
+ if [ -n "${CRYPT_ROOT}" ] && [ ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ]
then
good_msg "${NORMAL}To remote unlock LUKS-encrypted root device, run '${BOLD}unlock-luks root${NORMAL}'."
fi
- if [ -n "${CRYPT_SWAP}" -a ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ]
+ if [ -n "${CRYPT_SWAP}" ] && [ ! -f "${CRYPT_ROOT_OPENED_LOCKFILE}" ]
then
good_msg "${NORMAL}To remote unlock LUKS-encrypted swap device, run '${BOLD}unlock-luks swap${NORMAL}'."
fi