-
Notifications
You must be signed in to change notification settings - Fork 6
/
.hook-post
39 lines (37 loc) · 1.11 KB
/
.hook-post
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
#!/bin/bash
if [[ -t 1 ]]; then
if hash git 2>/dev/null; then
git config --global include.path "~/.gitconfig.common"
echo "Configure git?"
select yn in "Yes" "No"; do
case $yn in
Yes )
git config --global include.path "~/.gitconfig.common"
echo -n "Full name: "
read name
echo -n "Email: "
read email
git config --global user.name "$name"
git config --global user.email $email
break;;
No )
break;;
esac
done
fi
if hash ssh 2>/dev/null; then
echo "Import ssh keys and config?"
select yn in "Yes" "No"; do
case $yn in
Yes )
echo -n "Server name: "
read server
mkdir -p ~/.ssh
scp $server:".ssh/id_* .ssh/config" ~/.ssh
break;;
No )
break;;
esac
done
fi
fi