-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·110 lines (94 loc) · 3.63 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/sh
rocketlaunch_dir=`pwd` #from https://unix.stackexchange.com/a/52919/470623
if [ ! -e /usr/lib/filepeace ]; then sudo mkdir /usr/lib/filepeace; fi
echo "Installing filepeace..." && echo "- Installing filepeace command in /usr/bin..."
sudo cp -f filepeace /usr/bin
echo "- Turning filepeace into an executable..."
sudo chmod +x /usr/bin/filepeace
echo "Installing filepeace suite's apps..."
echo "Installing webpresent..."
cd include/webpresent
if [ ! -e .git ]; then git clone --no-checkout https://github.com/FilePeace/webpresent.git .; fi
if [ -e .git ]; then git pull; fi
git checkout -f
chmod +x install.sh && sh ./install.sh
cd "$rocketlaunch_dir"
echo "Installing folderstamp..."
cd include/folderstamp
if [ ! -e .git ]; then git clone --no-checkout https://github.com/FilePeace/folderstamp.git .; fi
if [ -e .git ]; then git pull; fi
git checkout -f
chmod +x install.sh && sh ./install.sh
cd "$rocketlaunch_dir"
echo "Installing verifact-hash..."
cd include/verifact-hash
if [ ! -e .git ]; then git clone --no-checkout https://github.com/FilePeace/verifact-hash.git .; fi
if [ -e .git ]; then git pull; fi
git checkout -f
chmod +x install.sh && sh ./install.sh
cd "$rocketlaunch_dir"
echo "Installing recordings-tools..."
cd include/recordings-tools
if [ ! -e .git ]; then git clone --no-checkout https://github.com/FilePeace/recordings-tools.git .; fi
if [ -e .git ]; then git pull; fi
git checkout -f
chmod +x install.sh && sh ./install.sh
cd "$rocketlaunch_dir"
echo "Installing mimetypes and their icons..." # this is continuously adding the same entries to /etc/mime.types and have to be fixed
cat >> /etc/mime.types <<EOF
text/x-md5 md5
text/x-sha256 sha256
text/x-md5sum md5sum
text/x-sha256sum sha256sum
EOF
#-<- should check if line is already added, before re-adding!
cat > /usr/share/mime/packages/x-md5.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-md5">
<comment>MD5 hash checksum file</comment>
<generic-icon name="text-x-md5"/>
<glob pattern="*.md5"/>
</mime-type>
</mime-info>
EOF
cat > /usr/share/mime/packages/x-sha256.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-sha256">
<comment>SHA256 hash checksum file</comment>
<generic-icon name="text-x-sha256"/>
<glob pattern="*.sha256"/>
</mime-type>
</mime-info>
EOF
cat > /usr/share/mime/packages/x-md5sum.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-md5sum">
<comment>MD5 hash checksum file</comment>
<generic-icon name="text-x-md5sum"/>
<glob pattern="*.md5sum"/>
</mime-type>
</mime-info>
EOF
cat > /usr/share/mime/packages/x-sha256sum.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-sha256sum">
<comment>SHA256 hash checksum file</comment>
<generic-icon name="text-x-sha256sum"/>
<glob pattern="*.sha256sum"/>
</mime-type>
</mime-info>
EOF
$maysudo update-mime-database /usr/share/mime
echo "Installing icons for .md5 and .sha256 files..."
cd include/icons
cp -r -f --preserve=all . /usr/share/icons/hicolor/scalable/mimetypes/
cd "$rocketlaunch_dir"
$maysudo gtk-update-icon-cache /usr/share/icons/gnome/ -f
echo "Installing icon for FilePeace..."
cp icon.svg /usr/share/icons/hicolor/scalable/apps/filepeace.svg
sudo gtk-update-icon-cache /usr/share/icons/gnome/ -f
echo "Done! Run 'filepeace' command to use it." && exit