-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·53 lines (41 loc) · 1.25 KB
/
install
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/bash
set -e
DOTFILES=$(cd $(dirname "${BASH_SOURCE[0]:-$0}") && pwd | sed -e s/\\/$//g)
. "$DOTFILES/includes/functions.sh"
. "$DOTFILES/includes/config.sh"
echo "Installing..."
#
# Install the startup script.
#
GREPTERM="dotfiles-init"
if [ ! -f "$HOME/.profile" ]; then
touch "$HOME/.profile"
else
sed -i.bak "/$GREPTERM/d" "$HOME/.profile"
rm -f "$HOME/.profile.bak"
fi
if [ ! -f "$HOME/.bashrc" ]; then
touch "$HOME/.bashrc"
else
sed -i.bak "/$GREPTERM/d" "$HOME/.bashrc"
rm -f "$HOME/.bashrc.bak"
fi
echo "source \"$DOTFILES/scripts/startup.sh\" # $GREPTERM" >> "$HOME/.profile"
echo "source \"$DOTFILES/scripts/bashrc.sh\" # $GREPTERM" >> "$HOME/.bashrc"
install_files "$DOTFILES/home" "$HOME"
install_files "$PLATFORM_DIR/home" "$HOME"
maybe_source "$PLATFORM_DIR/install.sh"
mkdir -p "$HOME/.ssh"
rm -f "$HOME/.ssh/id_rsa_digitalocean.pub"
rm -f "$HOME/.ssh/id_rsa_github.pub"
rm -f "$HOME/.ssh/id_rsa_mozilla.pub"
rm -f "$HOME/.ssh/id_rsa_personal.pub"
rm -f "$HOME/.ssh/id_rsa_heroku.pub"
if [ -f "$HOME/.ssh/config" ]; then
if [ $(stat -c %s "$HOME/.ssh/config") = "427" ]; then
rm "$HOME/.ssh/config"
fi
fi
if [ ! -f "$HOME/.ssh/config" ]; then
echo "Include \"$DOTFILES/shared/ssh/ssh_config\"" > "$HOME/.ssh/config"
fi