-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·66 lines (46 loc) · 1.41 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
installisohybrid() {
cd bin/isohybrid/src
. ./make.sh
cd ..
}
linkshit() {
echo "- creating portron symlinks from ${BASE}"
[ -f /usr/local/bin/electron-tgz2iso ] && rm -f /usr/local/bin/electron-tgz2iso
cd ${BASE}/bin
[ -d /usr/local/bin ] || mkdir -p /usr/local/bin
ln -s ${BASE}/bin/electron-tgz2iso /usr/local/bin/electron-tgz2iso || {
echo "- ERROR: Cannot create symbolic link of electron-tgz2iso to /usr/local/bin, maybe permissions?"
exit 1
}
}
echo "Portron Builder installation"
BASE="$(cd "$(dirname "$0")"; pwd)"
cd ${BASE}
if [ ! "`command -v mksquashfs`" ]; then
if [ "`command -v apt-get`" ]; then
apt-get update && apt-get install cdrtools squashfs
elif [ "`command -v brew`" ]; then
echo "- OSX detected, using brew"
brew install squashfs cdrtools gcc
else
echo "- ERROR: Please install squashfs (mksquashfs tool) using your distro archiver"
exit 1
fi
fi
echo "- Building isohybrid"
cd ${BASE}/bin/isohybrid/src
./make.sh
cd ..
if [ "`command -v mksquashfs`" ]; then
# success installing mksquashfs
echo "- success installing mksquashfs"
if [ -f ./isohybrid ]; then
# success installing isohybrid
echo "- success installing isohybrid"
linkshit
echo "- Installation complete."
exit 0
fi
fi
echo "Error, installation not complete."