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 # Exit for non-interactive sessions
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
@ -22,15 +24,15 @@ pathadd() {
getkey() { getkey() {
KEYFILE=~/.keys/${1} KEYFILE=~/.keys/${1}
if [ -f ${KEYFILE} ]; then if [ -f "${KEYFILE}" ]; then
if [ -x /usr/bin/security ]; then if [ -x /usr/bin/security ]; then
PASS=$(/usr/bin/security find-internet-password -l ssh:scott@wallace.sh -gw) PASS=$(/usr/bin/security find-internet-password -l ssh:scott@wallace.sh -gw)
else else
read -sp "Password: " PASS read -rsp "Password: " PASS
echo echo
fi 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 else
echo "No such key" >&2 echo "No such key" >&2
fi fi
@ -61,6 +63,7 @@ mkdir -p ~/src ~/tmp ~/var/log
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
pathadd /usr/local/sbin pathadd /usr/local/sbin
pathadd /usr/local/bin pathadd /usr/local/bin
pathadd ~/.local/bin
pathadd ~/bin pathadd ~/bin
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
@ -81,18 +84,19 @@ export PROMPT_COMMAND=__PROMPT_COMMAND
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
function datafart() { curl --data-binary @- datafart.com; } && export -f datafart function datafart() { curl --data-binary @- datafart.com; } && export -f datafart
function space() { du -ahx --max-depth=1 | sort -h; } && export -f space 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 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 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 glances 2>/dev/null) ]] && function top() { glances; } && export -f top
[[ -x $(which tree 2>/dev/null) ]] && alias tree="tree -AQh --du" [[ -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 # Include deployed bash config
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
for include in ~/.bashrc.d/*; do for include in ~/.bashrc.d/*; do
source ${include} source "${include}"
done done
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------