summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/install/CONTROL/postinst
Unidiff
Diffstat (limited to 'noncore/apps/qashmoney/install/CONTROL/postinst') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/install/CONTROL/postinst124
1 files changed, 0 insertions, 124 deletions
diff --git a/noncore/apps/qashmoney/install/CONTROL/postinst b/noncore/apps/qashmoney/install/CONTROL/postinst
deleted file mode 100755
index 034c5ac..0000000
--- a/noncore/apps/qashmoney/install/CONTROL/postinst
+++ b/dev/null
@@ -1,124 +0,0 @@
1#!/bin/sh
2
3# This renames all the old zmoney files if they are present
4if [ -f $HOME/zmoneyaccounts.db ]
5 then
6 mv $HOME/zmoneyaccounts.db $HOME/qmaccounts.db
7 fi
8if [ -f $HOME/zmoneytransactions.db ]
9 then
10 mv $HOME/zmoneytransactions.db $HOME/qmtransactions.db
11 fi
12if [ -f $HOME/zmoneymemory.db ]
13 then
14 mv $HOME/zmoneymemory.db $HOME/qmmemory.db
15 fi
16if [ -f $HOME/zmoneypreferences.db ]
17 then
18 mv $HOME/zmoneypreferences.db $HOME/qmpreferences.db
19 fi
20if [ -f $HOME/zmoneytransfers.db ]
21 then
22 mv $HOME/zmoneytransfers.db $HOME/qmtransfers.db
23 fi
24
25# This section makes a new directory in the $HOME/Applications
26# directory so QashMoney files will be automatically backed up.
27# Links from the $HOME directory are made to the actual files because
28# SQLite seems to want only a filename rather than a directory
29
30# Make the Applications directory if its not there
31if [ ! -d $HOME/Applications ]
32 then
33 mkdir $HOME/Applications
34 fi
35
36# Make the qashmoney directory
37if [ ! -d $HOME/Applications/qashmoney ]
38 then
39 mkdir $HOME/Applications/qashmoney
40 fi
41
42# Move all the database files to the temporary directory
43# if they are present and are not symbolic links
44if [ -f $HOME/qmbudgets.db ] && [ ! -L $HOME/qmbudgets.db ]
45 then
46 mv $HOME/qmbudgets.db /tmp
47 fi
48
49if [ -f $HOME/qmaccounts.db ] && [ ! -L $HOME/qmaccounts.db ]
50 then
51 mv $HOME/qmaccounts.db /tmp
52 fi
53
54if [ -f $HOME/qmmemory.db ] && [ ! -L $HOME/qmmemory.db ]
55 then
56 mv $HOME/qmmemory.db /tmp
57 fi
58
59if [ -f $HOME/qmpreferences.db ] && [ ! -L $HOME/qmpreferences.db ]
60 then
61 mv $HOME/qmpreferences.db /tmp
62 fi
63
64if [ -f $HOME/qmtransactions.db ] && [ ! -L $HOME/qmtransactions.db ]
65 then
66 mv $HOME/qmtransactions.db /tmp
67 fi
68
69if [ -f $HOME/qmtransfers.db ] && [ ! -L $HOME/qmtransfers.db ]
70 then
71 mv $HOME/qmtransfers.db /tmp
72 fi
73
74# Move all db files from /tmp directory to their final resting place
75if [ ! -f $HOME/Applications/qashmoney/qmbudgets.db ]
76 then
77 mv /tmp/qmbudgets.db $HOME/Applications/qashmoney
78 fi
79if [ ! -f $HOME/Applications/qashmoney/qmaccounts.db ]
80 then
81 mv /tmp/qmaccounts.db $HOME/Applications/qashmoney
82 fi
83if [ ! -f $HOME/Applications/qashmoney/qmmemory.db ]
84 then
85 mv /tmp/qmmemory.db $HOME/Applications/qashmoney
86 fi
87if [ ! -f $HOME/Applications/qashmoney/qmpreferences.db ]
88 then
89 mv /tmp/qmpreferences.db $HOME/Applications/qashmoney
90 fi
91if [ ! -f $HOME/Applications/qashmoney/qmtransactions.db ]
92 then
93 mv /tmp/qmtransactions.db $HOME/Applications/qashmoney
94 fi
95if [ ! -f $HOME/Applications/qashmoney/qmtransfers.db ]
96 then
97 mv /tmp/qmtransfers.db $HOME/Applications/qashmoney
98 fi
99
100# If by chance there are any db files or links in the $HOME directory
101#delete them
102rm -rf $HOME/qmbudgets.db
103rm -rf $HOME/qmaccounts.db
104rm -rf $HOME/qmmemory.db
105rm -rf $HOME/qmpreferences.db
106rm -rf $HOME/qmtransactions.db
107rm -rf $HOME/qmtransfers.db
108
109# Create symbolic links for the $HOME to the $HOME/Applications/qashmoney
110# directory
111ln -s $HOME/Applications/qashmoney/qmbudgets.db $HOME/qmbudgets.db
112ln -s $HOME/Applications/qashmoney/qmaccounts.db $HOME/qmaccounts.db
113ln -s $HOME/Applications/qashmoney/qmmemory.db $HOME/qmmemory.db
114ln -s $HOME/Applications/qashmoney/qmpreferences.db $HOME/qmpreferences.db
115ln -s $HOME/Applications/qashmoney/qmtransactions.db $HOME/qmtransactions.db
116ln -s $HOME/Applications/qashmoney/qmtransfers.db $HOME/qmtransfers.db
117
118# Remove all .db files that remain in the /tmp directory
119rm -rf /tmp/qmbudgets.db
120rm -rf /tmp/qmaccounts.db
121rm -rf /tmp/qmmemory.db
122rm -rf /tmp/qmpreferences.db
123rm -rf /tmp/qmtransactions.db
124rm -rf /tmp/qmtransfers.db