-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathessentials.sh
More file actions
65 lines (42 loc) · 1.26 KB
/
Copy pathessentials.sh
File metadata and controls
65 lines (42 loc) · 1.26 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#Gracefully borrowed from @alexsleat
echo "************************"
echo "** Essentials install **"
echo "************************"
if [ "$(whoami)" != "root" ]; then
echo "ERROR: You must be root"
echo "Exiting"
exit 1
fi
echo "Installing git"
sudo apt-get install git-core git-gui git-doc
DIRECTORY="/.ssh"
if [ -d "$DIRECTORY" ]; then
# Control will enter here if $DIRECTORY exists
echo "SSH keys already exist, making backups in ~/.ssh/key_backup"
mkdir key_backup
cp id_rsa* key_backup
rm id_rsa*
fi
echo "Enter email address:"
read EMAILADDR
#Generate new keys
ssh-keygen -t rsa -C $EMAILADDR
#Open the file for pasting into github "“Account Settings” > Click “SSH Public Keys” > Click “Add another public key”"
gedit ~/.ssh/id_rsa.pub
#Check it's been setup
ssh -T git@github.com
echo "Enter first name (space) second name:"
read FIRSTNAME LASTNAME
#Setup github details
git config --global user.name "$FIRSTNAME $LASTNAME"
git config --global user.email "$EMAILADDR"
echo "Enter github username:"
read GITUSER
echo "Enter github token:"
read GITTOKEN
git config --global github.user $GITUSER
git config --global github.token $GITTOKEN
echo "Git Setup done!"
echo "Other essentials"
sudo apt-get install kile chromium-browser