浏览代码

Install tomb

Bob Mottram 9 年前
父节点
当前提交
2307844a49
共有 2 个文件被更改,包括 69 次插入0 次删除
  1. 66
    0
      src/freedombone-utils-filesystem
  2. 3
    0
      src/freedombone-utils-setup

+ 66
- 0
src/freedombone-utils-filesystem 查看文件

@@ -0,0 +1,66 @@
1
+#!/bin/bash
2
+#
3
+# .---.                  .              .
4
+# |                      |              |
5
+# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
+# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
+# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
+#
9
+#                    Freedom in the Cloud
10
+#
11
+# Filesystem encryption, etc
12
+#
13
+# License
14
+# =======
15
+#
16
+# Copyright (C) 2014-2016 Bob Mottram <bob@robotics.uk.to>
17
+#
18
+# This program is free software: you can redistribute it and/or modify
19
+# it under the terms of the GNU Affero General Public License as published by
20
+# the Free Software Foundation, either version 3 of the License, or
21
+# (at your option) any later version.
22
+#
23
+# This program is distributed in the hope that it will be useful,
24
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
+# GNU Affero General Public License for more details.
27
+#
28
+# You should have received a copy of the GNU Affero General Public License
29
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
+
31
+TOMB_REPO="https://github.com/dyne/Tomb"
32
+TOMB_COMMIT='c80ebd6d6ed77980eb5b559757e03ea13a29bdd1'
33
+
34
+function install_tomb {
35
+	function_check set_repo_commit
36
+	set_repo_commit $INSTALL_DIR/tomb "Tomb commit" "$TOMB_COMMIT" $TOMB_REPO
37
+
38
+	if [ -f $COMPLETION_FILE ]; then
39
+		if grep -Fxq "install_tomb" $COMPLETION_FILE; then
40
+			return
41
+		fi
42
+	fi
43
+
44
+	apt-get -y install cryptsetup zsh
45
+
46
+	if [ ! -d $INSTALL_DIR ]; then
47
+		mkdir -p $INSTALL_DIR
48
+	fi
49
+	cd $INSTALL_DIR
50
+
51
+	git_clone $TOMB_REPO tomb
52
+	cd $INSTALL_DIR/tomb
53
+
54
+	git checkout $TOMB_COMMIT -b $TOMB_COMMIT
55
+	if ! grep -q "Tomb commit" $COMPLETION_FILE; then
56
+		echo "Tomb commit:$TOMB_COMMIT" >> $COMPLETION_FILE
57
+	else
58
+		sed -i "s/Tomb commit.*/Tomb commit:$TOMB_COMMIT/g" $COMPLETION_FILE
59
+	fi
60
+
61
+	make install
62
+
63
+	echo 'install_tomb' >> $COMPLETION_FILE
64
+}
65
+
66
+# NOTE: deliberately no exit 0

+ 3
- 0
src/freedombone-utils-setup 查看文件

@@ -407,6 +407,9 @@ function setup_utils {
407 407
 
408 408
 	function_check upgrade_golang
409 409
 	upgrade_golang
410
+
411
+	function_check install_tomb
412
+	install_tomb
410 413
 }
411 414
 
412 415
 function setup_email {