From fd7e470914da82aaf575f2e632b9c65e312eb921 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Mon, 31 Oct 2022 01:36:12 +0000 Subject: [PATCH] ansible_host: ShellCheck fixes --- roles/ansible_host/files/root-bashrc.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/ansible_host/files/root-bashrc.sh b/roles/ansible_host/files/root-bashrc.sh index 3d2737d..403d99a 100644 --- a/roles/ansible_host/files/root-bashrc.sh +++ b/roles/ansible_host/files/root-bashrc.sh @@ -1,3 +1,4 @@ +# shellcheck shell=sh # .bashrc # User specific aliases and functions @@ -8,12 +9,15 @@ alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then + # shellcheck source=/dev/null . /etc/bashrc fi # make sure that ssh agent is running and connect to it -[ -f /root/.ssh/agent ] && source /root/.ssh/agent > /dev/null -if ! kill -0 "${SSH_AGENT_PID}" > /dev/null 2>&1 ; then +# shellcheck source=/dev/null +[ -f /root/.ssh/agent ] && . /root/.ssh/agent > /dev/null +if ! kill -0 "$SSH_AGENT_PID" > /dev/null 2>&1 ; then ssh-agent -s > /root/.ssh/agent - source /root/.ssh/agent > /dev/null + # shellcheck source=/dev/null + . /root/.ssh/agent > /dev/null fi