Statistics
| Revision:

root / tmp / org.txm.setups / shared / debian / DEBIAN / postinst @ 917

History | View | Annotate | Download (1.6 kB)

1
#!/bin/bash
2
# Source debconf library.
3
#. /usr/share/debconf/confmodule
4

    
5
VERSION=-TXMVERSION
6
TXMINSTALLDIR="/usr/lib/TXM${VERSION}"
7

    
8
# create txm group
9
cat /etc/group | grep txm
10
if [ $? != 0 ]; then
11
	sudo groupadd txm
12
	if [ $? != 0 ]; then
13
		echo "** TXM install: failed to create 'txm' group" >&2
14
	exit 1;
15
fi
16
fi
17

    
18
# set 'txm' group to TXM install files
19
sudo chgrp -R txm $TXMINSTALLDIR
20
if [ $? != 0 ]; then
21
	echo "** TXM install: failed to set the 'txm' group to TXM install files" >&2
22
	exit 1;
23
fi
24

    
25
# and add 'txm' group to the current SUDO_USER
26
for user in `users`
27
do
28
	sudo usermod -a -G txm $user
29
	
30
	if [ $? != 0 ]; then
31
		echo "usermod -a -G txm $user"
32
		echo "** TXM install: failed to set 'txm' group to $user" >&2
33
	exit 1;
34
fi
35
done
36

    
37
# set CQP executable rights
38
chmod +x $TXMINSTALLDIR/plugins/org.txm.libs.cqp.linux_*/res/linux64/*
39
if [ $? != 0 ]; then
40
	echo "** TXM install: Failed to set org.txm.libs.cqp.linux plugin file rights : $TXMINSTALLDIR/plugins/org.txm.libs.cqp.linux_*/res/linux64/*" >&2
41
	exit 1;
42
fi
43

    
44
# set R executable rights
45
chmod -R +x $TXMINSTALLDIR/plugins/org.txm.statsengine.r.core.linux_*/res/linux64/*
46
if [ $? != 0 ]; then
47
	echo "** TXM install: Failed to set org.txm.statsengine.r.core.linux plugin file rights : $TXMINSTALLDIR/plugins/org.txm.statsengine.r.core.linux_*/res/linux64/*" >&2
48
	exit 1;
49
fi
50

    
51
# create stamp file
52
touch "$TXMINSTALLDIR/STAMP"
53
if [ $? != 0 ]; then
54
	echo "** TXM install: Failed to create install TIMESTAMP file : $TXMINSTALLDIR/STAMP" >&2
55
	exit 1;
56
fi
57

    
58
#db_stop
59
echo "** TXM install: done, type TXM${VERSION}& in a terminal to launch the application or use your desktop application launcher."
60
exit 0