-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuser-env.sh
executable file
·45 lines (37 loc) · 1.01 KB
/
user-env.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
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
echo "Installing vim-lite ..."
sudo pkg install -y vim-lite
# Setup user environment (personal prefs)
shrcSetup () {
echo " configuring .shrc ..."
cp /usr/share/skel/dot.shrc ~/.shrc
sed -E -i '' 's/set -o emacs/# set -o emacs/' ~/.shrc
sed -E -i '' 's/# set -o vi/set -o vi/' ~/.shrc
sed -E -i '' 's/^# umask 022/umask 022/' ~/.shrc
sed -E -i '' "s/# alias cp='cp -ip'/alias cp='cp -ip'/" ~/.shrc
sed -E -i '' "s/# alias mv='mv -i'/alias mv='mv -i'/" ~/.shrc
sed -E -i '' "s/# alias rm='rm -i'/alias rm='rm -i'/" ~/.shrc
sed '/alias g/ a \
alias d=\"ls -alFG\"
' ~/.shrc > /tmp/shrc
mv /tmp/shrc ~/.shrc
cat << EOF >> ~/.shrc
# set prompt: ``username@hostname$ ''
PS1="\`whoami\`@\`hostname | sed 's/\..*//'\`"
case \`id -u\` in
0) PS1="\${PS1}# ";;
*) PS1="\${PS1}$ ";;
esac
EOF
}
if [ -f ~/.shrc ]; then
echo "~/.shrc exists"
else
shrcSetup
fi
if [ -f ~/.profile ]; then
echo "~/.profile exists"
else
echo " creating .profile ..."
cp /usr/share/skel/dot.profile ~/.profile
fi