-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
50 lines (41 loc) · 1.05 KB
/
install.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
44
45
46
47
48
49
50
#!/bin/bash
echo "install netstat to check status"
apt install net-tools
echo "I will prepare linux for updates"
apt-get autoremove -y
apt-get update -y
echo "I will install git"
apt-get install git
git --version
echo "I will instal nodejs or update"
npm install -g npm
echo "I will install Node environment to start project"
apt-get install nodejs npm -y
npm --version
echo "I will install NPM packages on this project ..."
full_path=$(realpath $0)
dir_path=$(dirname $full_path)
#echo $dir_path
which npm
if [ $? -eq 0 ]
then
ls -d $dir_path
npm install --prefix $dir_path
npm install forever -g
#echo "The script ran ok"
exit 0
else
echo "npm is not installed on this system!" >&2
exit 1
fi
# give rights to execute
chmod u+r+x *.sh
#CODE NO
#1 - Catchall for general errors
#2 - Misuse of shell builtins (according to Bash documentation)
#126 - Command invoked cannot execute
#127 - “command not found”
#128 - Invalid argument to exit
#128+n - Fatal error signal “n”
#130 - Script terminated by Control-C
#255\* - Exit status out of range