Update .bashrc

This commit is contained in:
Scott Wallace 2022-05-09 14:37:39 +01:00
parent be42729e44
commit 881b713841
Signed by: scott
GPG key ID: AA742FDC5AFE2A72

20
.bashrc Executable file → Normal file
View file

@ -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
#--------------------------------------------------------------------------------