forked from pierrehirel/atomsk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (41 loc) · 1.42 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·61 lines (41 loc) · 1.42 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
#!/bin/bash
# This script installs Atomsk in system directories
# so that all users can use it. This script must be run
# with root permissions.
BINPATH=/usr/local/bin/
DOCPATH=/usr/local/share/doc/
MPATH=/usr/local/share/man/man1/
if [ ! -e 'atomsk' ] ; then
echo "X!X ERROR: the program 'atomsk' does not exist in current directory."
else
if [ -w ${BINPATH} ] ; then
echo "<?> Atomsk will be installed in ${BINPATH}. Continue? (y/n)"
read answer
if [ "${answer}" = "y" ] ; then
# System configuration file
cp -rf ./etc/atomsk.conf /etc/
# Atomsk binary
chmod +x atomsk
cp atomsk ${BINPATH}
# Atomsk tools
chmod +x ./tools/*.sh
cp ./tools/* ${BINPATH}
echo ">>> The program was successfuly installed in ${BINPATH}"
echo " To run it, enter 'atomsk' in a terminal."
# Atomsk documentation
mkdir -p ${DOCPATH}/atomsk
rm -rf ${DOCPATH}/atomsk/*
cp -rf ./doc/* ${DOCPATH}/atomsk/
chmod -R a+r ${DOCPATH}/atomsk/
echo ">>> The html documentation was installed. You may read it by entering the"
echo " following address in your Web browser: ${DOCPATH}atomsk/index.html"
# Atomsk man page
mkdir -p ${MPATH}
gzip -c ./man/atomsk >${MPATH}/atomsk.1.gz
else
echo ">>> Installation aborted."
fi
else
echo "X!X ERROR: this script must be run as root or with sudo."
fi
fi