-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·33 lines (25 loc) · 1.15 KB
/
setup.sh
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
# This script is designed to be run on a newly created Dreamhost shell account
DOMAIN=$(ls ~ | grep "\.")
# first, set up git with my info
git config --global core.excludesfile ~/.gitignore
git config --global user.name "Rob Nugen"
git config --global user.email [email protected]
git config --global alias.innit '!git init && git commit -m "Empty commit on which to base the repo" --allow-empty'
# copy files from git repo to ~
cp .bash_aliases $HOME/
cp .gitignore $HOME/
# Now append this account's domain to the .gitignore
# N.B. this depends on the domain name having dots.in.it.com
# and nothing else having dots (except for dot files such as .gitignore)
## todo: figure out how to use $DOMAIN env variable
ls ~ | grep "\." >> $HOME/.gitignore
# append the contents of .bash_profile_append to ~/.bash_profile
cat .bash_profile_append >> $HOME/.bash_profile
# Set up .ssh so we can login without using a password
# N.B. this assumes we have copied our public key to the DH machine: ~/authorized_keys
# and further assumes there is no .ssh/ at all
mkdir ~/.ssh
chmod 700 ~/.ssh
mv ~/authorized_keys ~/.ssh/
chmod 400 ~/.ssh/authorized_keys