-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·33 lines (30 loc) · 864 Bytes
/
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
#!/bin/bash
ver=1.0.0
wget https://github.com/yuwen41200/lamp-deploy/raw/master/release/dep-${ver}.jar
sudo chown root:root dep-${ver}.jar
sudo chmod 755 dep-${ver}.jar
sudo mv dep-${ver}.jar /usr/local/bin/
config () {
if [ -f $1 ]; then
sed -i '/alias dep/d' $1
newline=$(tail -c 1 $1)
if [ "$newline" != "" ]; then
printf "\n" >> $1
fi
case "$2" in
1)
printf "alias dep='java -jar /usr/local/bin/dep-${ver}.jar'\n" >> $1
;;
2)
printf "alias dep 'java -jar /usr/local/bin/dep-${ver}.jar'\n" >> $1
;;
*)
printf "alias dep='java -jar /usr/local/bin/dep-${ver}.jar'\n" >> $1
;;
esac
fi
}
config ~/.bashrc 1
config ~/.zshrc 1
config ~/.cshrc 2
config ~/.tcshrc 2