-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_setup.sh
executable file
·59 lines (48 loc) · 1.3 KB
/
01_setup.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
#!/bin/bash
cd "`dirname \"$0\"`"
sudo apt-get -y -qq install git
# settings
iso_url="http://de.releases.ubuntu.com/16.10/ubuntu-16.10-desktop-amd64.iso"
expected_hash="4405c37d61b5cac6c89eaf379c035058ed7db8594abd209337276c7c4556787e"
addon_maker_url="https://github.com/CodersOS/live-addon-maker.git"
# computed settings
iso_name="`basename \"$iso_url\"`"
iso_file="live-addon-maker/$iso_name"
echo "Checking live-addon-maker"
if [ -e "live-addon-maker" ]; then
(
cd "live-addon-maker"
git pull
)
else
git clone --depth=1 "$addon_maker_url" || {
echo "Could not clone live-addon-maker"
exit 1
}
fi
[ -e "live-addon-maker" ] || {
echo "expected live-addon-maker directory"
echo `ls`
exit 1
}
(
echo "Downloading iso"
cd "live-addon-maker"
wget -c "$iso_url"
)
if [ -n "$expected_hash" ]; then
echo "Checking sha sum"
sha_output="`sha256sum \"$iso_file\"`"
echo "sha256sum output: $sha_output"
iso_hash="`echo \"$sha_output\" | grep -oE '^\S+'`"
[ "$expected_hash" == "$iso_hash" ] || {
echo "SHA256 hashes do not match."
echo "Expected: '$expected_hash'"
echo " Got: '$iso_hash'"
exit 1
}
fi
echo "Deleting examples"
rm -f live-addon-maker/examples/*.squashfs live-addon-maker/*.squashfs *.squashfs
rm -f ./link.iso
ln -s -T "$iso_file" "link.iso"