Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/patch_my_xo/setup.sh
blob: 3c432288f7affa592b3e1049930cfa6724abb234 (plain)
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
#!/bin/sh

# Name of archives
setup_bundle=semanticxo.tar.gz

# Source function library
. /etc/rc.d/init.d/functions

# Install the triple store on the XO and replace the Journal data store
setup()
{
	if [ ! -f $setup_bundle ]; then
		echo $"Failed to locate setup bundle !"
		failure
		echo
	fi

	echo -n $"Copy the original datastore-service file"
	cp /usr/bin/datastore-service ./datastore-service.bck
	success
	echo

	echo -n $"Unpack SemanticXO bundle"
	tar -xvzf $setup_bundle --no-same-owner -C / > /dev/null
	chmod a+x /usr/sbin/replicate-graphs
	chmod a+x /usr/bin/datastore-service
	success
	echo

	echo -n $"Activate triple store"
	chmod a+x /opt/redstore/redstore
	chmod a+x /opt/redstore/wrapper.sh
	systemctl enable redstore.service
	success
	echo

	echo -n $"Install demo activities"
	sudo -u olpc sugar-install-bundle /tmp/Mail-1.xo
	sudo -u olpc sugar-install-bundle /tmp/JournalBrowser-1.xo
	sudo -u olpc sugar-install-bundle /tmp/Review-1.xo
	success
	echo
}

# Remove everything that was installed
remove()
{
	echo -n $"Restore the original datastore"
	cp ./datastore-service.bck /usr/bin/datastore-service 
	success
	echo
}


# Handle command line parameter
case "$1" in
	setup)
		setup
		;;
	remove)
		remove
		;;
	*)
		echo $"Usage: $0 {setup|remove}"
		;;
esac
exit $RETVAL