mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 17:52:26 +00:00
Add bash functions
This commit is contained in:
28
bash/.bash_functions
Normal file
28
bash/.bash_functions
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
# Git pulls latest dotfiles
|
||||
function update-dotfiles() {
|
||||
if [ -d "${HOME}/.dotfiles" ]; then
|
||||
cd $HOME/.dotfiles
|
||||
git pull --rebase --autostash
|
||||
fi
|
||||
if [ -d "${HOME}/.dotfiles-private" ]; then
|
||||
cd $HOME/.dotfiles-private
|
||||
git pull --rebase --autostash
|
||||
fi
|
||||
}
|
||||
|
||||
function add-sshkey() {
|
||||
TIMEOUT="1h"
|
||||
NAME=$1
|
||||
|
||||
if [ -z "$NAME" ]; then
|
||||
echo "Current Keys"
|
||||
ssh-add -L
|
||||
else
|
||||
if [ -f "~/.ssh/id_ed25519_${NAME}" ]; then
|
||||
ssh-add -t $TIMEOUT "~/.ssh/id_ed25519_${NAME}"
|
||||
else
|
||||
echo "No key named ${NAME} found..."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user