Statistics
| Revision:

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

History | View | Annotate | Download (1.7 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 'txm' group rights
38
chmod -R g+w $TXMINSTALLDIR
39

    
40

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

    
48
# set R executable rights
49
chmod -R +x $TXMINSTALLDIR/plugins/org.txm.statsengine.r.core.linux_*/res/linux64/*
50
if [ $? != 0 ]; then
51
	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
52
	exit 1;
53
fi
54

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

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