From 881b7138418e03fd169776818161e26a3c287e93 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Mon, 9 May 2022 14:37:39 +0100 Subject: [PATCH] Update .bashrc --- .bashrc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) mode change 100755 => 100644 .bashrc diff --git a/.bashrc b/.bashrc old mode 100755 new mode 100644 index b5a3141..47f2c5e --- a/.bashrc +++ b/.bashrc @@ -1,3 +1,5 @@ +#!/bin/bash + #-------------------------------------------------------------------------------- # Exit for non-interactive sessions #-------------------------------------------------------------------------------- @@ -22,15 +24,15 @@ pathadd() { getkey() { KEYFILE=~/.keys/${1} - if [ -f ${KEYFILE} ]; then + if [ -f "${KEYFILE}" ]; then if [ -x /usr/bin/security ]; then PASS=$(/usr/bin/security find-internet-password -l ssh:scott@wallace.sh -gw) else - read -sp "Password: " PASS + read -rsp "Password: " PASS echo fi - openssl rsautl -decrypt -inkey ~/.ssh/scott@wallace.sh -passin "pass:${PASS}" -in ${KEYFILE} 2>/dev/null + openssl rsautl -decrypt -inkey ~/.ssh/scott@wallace.sh -passin "pass:${PASS}" -in "${KEYFILE}" 2>/dev/null else echo "No such key" >&2 fi @@ -61,6 +63,7 @@ mkdir -p ~/src ~/tmp ~/var/log #-------------------------------------------------------------------------------- pathadd /usr/local/sbin pathadd /usr/local/bin +pathadd ~/.local/bin pathadd ~/bin #-------------------------------------------------------------------------------- @@ -81,18 +84,19 @@ export PROMPT_COMMAND=__PROMPT_COMMAND #-------------------------------------------------------------------------------- function datafart() { curl --data-binary @- datafart.com; } && export -f datafart function space() { du -ahx --max-depth=1 | sort -h; } && export -f space -if ! alias ll >/dev/null 2>&1; then function ll() { ls -l ${@}; } && export -f ll; fi -[[ ! -x $(which psgrep 2>/dev/null) ]] && function psgrep() { ps -ef | grep ${@} | grep -v ${$}; } && export -f psgrep -[[ -x $(which glances 2>/dev/null) ]] && function top() { glances; } && export -f top +if ! alias ll >/dev/null 2>&1; then function ll() { ls -l "${@}"; } && export -f ll; fi +[[ ! -x $(which psgrep 2>/dev/null) ]] && function psgrep() { ps -ef | grep "${@}" | grep -v ${$}; } && export -f psgrep +# [[ -x $(which glances 2>/dev/null) ]] && function top() { glances; } && export -f top [[ -x $(which tree 2>/dev/null) ]] && alias tree="tree -AQh --du" -export GIT_SSH_COMMAND="$(which ssh) -o RemoteCommand=none" +GIT_SSH_COMMAND="$(which ssh) -o RemoteCommand=none" +export GIT_SSH_COMMAND #-------------------------------------------------------------------------------- #-------------------------------------------------------------------------------- # Include deployed bash config #-------------------------------------------------------------------------------- for include in ~/.bashrc.d/*; do - source ${include} + source "${include}" done #--------------------------------------------------------------------------------