summaryrefslogtreecommitdiff
path: root/debian/email-service-tools.postinst
blob: 16723783d68239c6bbdb581f3ab0db6b688a6c4f (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
#!/bin/sh

#################################################################
# Copy db file to /opt/dbspace
#################################################################

echo "[EMAIL-SERVICE] Setting db permission & owner."

if [ ${USER} = "root" ]
then
	chown :6006 /opt/dbspace/.email-service.db
	chmod 660 	/opt/dbspace/.email-service.db
	chown :6006 /opt/dbspace/.email-service.db-journal
	chmod 660 	/opt/dbspace/.email-service.db-journal
else
	echo "[EMAIL-SERVICE] Can't change owner. USER is not root." 
fi
echo "[EMAIL-SERVICE] Finish setting and owner."


#echo "[EMAIL-SERVICE] Start copying db file to /opt/dbspace ..."
#DB_PATH=/opt/dbspace/
#if test ! -d ${DB_PATH}
#then
#	mkdir /opt/dbspace
#	echo "[EMAIL-SERVICE] Copy Error!!! There is not '${DB_PATH}'!!"
#else
#	if test ! -s "${DB_PATH}/.email-service.db"
#	then
#		echo "[EMAIL-SERVICE] .email-service.db is copied to ${DB_PATH}"
#		cp /usr/share/email-service/.email-service.db ${DB_PATH}
#		cp /usr/share/email-service/.email-service.db-journal ${DB_PATH}
		# change mod and owner
#		chown :6006 /opt/dbspace/.email-service.db
#		chmod 660 /opt/dbspace/.email-service.db
#		chown :6006 /opt/dbspace/.email-service.db-journal
#		chmod 660 /opt/dbspace/.email-service.db-journal
#	else
#		echo "[EMAIL-SERVICE] .email-service.db already exists."
#	fi
#fi
#echo "[EMAIL-SERVICE] Finish copying db file. "

#echo "[EMAIL-TEST-APP] Start setting permission ..."
# 1. executables
#chmod 700 /usr/bin/email_test_app

#echo "[EMAIL-TEST-APP] Finish setting permission."

# 3. resources


#################################################################
# Change file owner
#################################################################
#echo "[EMAIL-TEST-APP] Start setting owner ..."
#if [ ${USER} == "root" ]
#then
	# 1. executables
#	chown root:root /usr/bin/email_test_app
#else
#	echo "[EMAIL-TEST-APP] Can't change owner. USER is not root." 
#fi
#echo "[EMAIL-TEST-APP] Finish setting and owner."