summaryrefslogtreecommitdiffstats
path: root/init_new_user.sh
blob: 42420c863569acc9cb67874f284bd9b80b16e332 (plain)
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
#!/bin/bash

set -e

cd $HOME
mkdir -p git

clone_repo() {
	repo=$1
	dest_dir=$2

	if [[ -e $dest_dir ]]; then
		return 0
	fi

	if type git &>/dev/null; then
		git clone "git://git.server-speed.net/users/flo/$repo" "$dest_dir"
	else
		wget https://git.server-speed.net/users/flo/$repo/snapshot/master.tar.gz -O - | tar -C "$dest_dir" --strip-components 1 -xzf -
	fi
}

clone_repo bin bin
clone_repo dotfiles git/dotfiles

mkdir -p .config/htop

for i in .zshrc .vimrc .screenrc .screenrc-2 .zprofile .config/htop/htoprc .dircolors .vim .gitconfig .gitignore .bashrc .zshenv .tmux.conf; do
	ln -sf git/dotfiles/$i $i
done

mkdir -p .zsh
touch .zshrc.local