-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·34 lines (27 loc) · 1.22 KB
/
Copy pathsetup
File metadata and controls
executable file
·34 lines (27 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
#
# Run this by calling ".personalconfigs/setup.sh"
# of course you don't have to call the directory
# .personalconfigs should you wish to change it.
#
# All the fun init stuff you have to do in Bash! Yay!
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
scriptdir="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Create the symbolic links (essentially this is the setup)
ln -svf $scriptdir/ssh ~/.ssh
ln -svf $scriptdir/inputrc ~/.inputrc
ln -svf $scriptdir/bash_profile ~/.bash_profile
ln -svf $scriptdir/bashrc ~/.bashrc
ln -svf $scriptdir/gitconfig ~/.gitconfig
ln -svf $scriptdir/gitignore_global ~/.gitignore_global
# Setup link to git config private if you have one
[ -f $scriptdir/gitconfig_private ] && ln -svf $scriptdir/gitconfig_private ~/.gitconfig_private
# Setup link to secrets file if you have one
[ -f $scriptdir/secrets ] && ln -svhf $scriptdir/secrets ~/.secrets
# Consume ssh host keys from your known hosts list if you have one.
[ -f $scriptdir/ssh/known_hosts_list ] && ssh-keyscan -t rsa,dsa,ecdsa,ed25519 -f $scriptdir/ssh/known_hosts_list > ~/.ssh/known_hosts