author | allenforsythe <allenforsythe> | 2003-05-14 18:04:01 (UTC) |
---|---|---|
committer | allenforsythe <allenforsythe> | 2003-05-14 18:04:01 (UTC) |
commit | 9c5671a47c3f4d3510dc18d70914f6d7df752a25 (patch) (unidiff) | |
tree | fe52ea0ed4b22cb143c62715345921322581a97d /noncore/apps/qashmoney/install | |
parent | dabb32d52954874ffd8c79de3a82923dde5b27af (diff) | |
download | opie-9c5671a47c3f4d3510dc18d70914f6d7df752a25.zip opie-9c5671a47c3f4d3510dc18d70914f6d7df752a25.tar.gz opie-9c5671a47c3f4d3510dc18d70914f6d7df752a25.tar.bz2 |
Initial revision
Diffstat (limited to 'noncore/apps/qashmoney/install') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/install/CONTROL/postinst | 124 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/install/CONTROL/preinst | 8 |
2 files changed, 132 insertions, 0 deletions
diff --git a/noncore/apps/qashmoney/install/CONTROL/postinst b/noncore/apps/qashmoney/install/CONTROL/postinst new file mode 100755 index 0000000..034c5ac --- a/dev/null +++ b/noncore/apps/qashmoney/install/CONTROL/postinst | |||
@@ -0,0 +1,124 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # This renames all the old zmoney files if they are present | ||
4 | if [ -f $HOME/zmoneyaccounts.db ] | ||
5 | then | ||
6 | mv $HOME/zmoneyaccounts.db $HOME/qmaccounts.db | ||
7 | fi | ||
8 | if [ -f $HOME/zmoneytransactions.db ] | ||
9 | then | ||
10 | mv $HOME/zmoneytransactions.db $HOME/qmtransactions.db | ||
11 | fi | ||
12 | if [ -f $HOME/zmoneymemory.db ] | ||
13 | then | ||
14 | mv $HOME/zmoneymemory.db $HOME/qmmemory.db | ||
15 | fi | ||
16 | if [ -f $HOME/zmoneypreferences.db ] | ||
17 | then | ||
18 | mv $HOME/zmoneypreferences.db $HOME/qmpreferences.db | ||
19 | fi | ||
20 | if [ -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 | ||
31 | if [ ! -d $HOME/Applications ] | ||
32 | then | ||
33 | mkdir $HOME/Applications | ||
34 | fi | ||
35 | |||
36 | # Make the qashmoney directory | ||
37 | if [ ! -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 | ||
44 | if [ -f $HOME/qmbudgets.db ] && [ ! -L $HOME/qmbudgets.db ] | ||
45 | then | ||
46 | mv $HOME/qmbudgets.db /tmp | ||
47 | fi | ||
48 | |||
49 | if [ -f $HOME/qmaccounts.db ] && [ ! -L $HOME/qmaccounts.db ] | ||
50 | then | ||
51 | mv $HOME/qmaccounts.db /tmp | ||
52 | fi | ||
53 | |||
54 | if [ -f $HOME/qmmemory.db ] && [ ! -L $HOME/qmmemory.db ] | ||
55 | then | ||
56 | mv $HOME/qmmemory.db /tmp | ||
57 | fi | ||
58 | |||
59 | if [ -f $HOME/qmpreferences.db ] && [ ! -L $HOME/qmpreferences.db ] | ||
60 | then | ||
61 | mv $HOME/qmpreferences.db /tmp | ||
62 | fi | ||
63 | |||
64 | if [ -f $HOME/qmtransactions.db ] && [ ! -L $HOME/qmtransactions.db ] | ||
65 | then | ||
66 | mv $HOME/qmtransactions.db /tmp | ||
67 | fi | ||
68 | |||
69 | if [ -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 | ||
75 | if [ ! -f $HOME/Applications/qashmoney/qmbudgets.db ] | ||
76 | then | ||
77 | mv /tmp/qmbudgets.db $HOME/Applications/qashmoney | ||
78 | fi | ||
79 | if [ ! -f $HOME/Applications/qashmoney/qmaccounts.db ] | ||
80 | then | ||
81 | mv /tmp/qmaccounts.db $HOME/Applications/qashmoney | ||
82 | fi | ||
83 | if [ ! -f $HOME/Applications/qashmoney/qmmemory.db ] | ||
84 | then | ||
85 | mv /tmp/qmmemory.db $HOME/Applications/qashmoney | ||
86 | fi | ||
87 | if [ ! -f $HOME/Applications/qashmoney/qmpreferences.db ] | ||
88 | then | ||
89 | mv /tmp/qmpreferences.db $HOME/Applications/qashmoney | ||
90 | fi | ||
91 | if [ ! -f $HOME/Applications/qashmoney/qmtransactions.db ] | ||
92 | then | ||
93 | mv /tmp/qmtransactions.db $HOME/Applications/qashmoney | ||
94 | fi | ||
95 | if [ ! -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 | ||
102 | rm -rf $HOME/qmbudgets.db | ||
103 | rm -rf $HOME/qmaccounts.db | ||
104 | rm -rf $HOME/qmmemory.db | ||
105 | rm -rf $HOME/qmpreferences.db | ||
106 | rm -rf $HOME/qmtransactions.db | ||
107 | rm -rf $HOME/qmtransfers.db | ||
108 | |||
109 | # Create symbolic links for the $HOME to the $HOME/Applications/qashmoney | ||
110 | # directory | ||
111 | ln -s $HOME/Applications/qashmoney/qmbudgets.db $HOME/qmbudgets.db | ||
112 | ln -s $HOME/Applications/qashmoney/qmaccounts.db $HOME/qmaccounts.db | ||
113 | ln -s $HOME/Applications/qashmoney/qmmemory.db $HOME/qmmemory.db | ||
114 | ln -s $HOME/Applications/qashmoney/qmpreferences.db $HOME/qmpreferences.db | ||
115 | ln -s $HOME/Applications/qashmoney/qmtransactions.db $HOME/qmtransactions.db | ||
116 | ln -s $HOME/Applications/qashmoney/qmtransfers.db $HOME/qmtransfers.db | ||
117 | |||
118 | # Remove all .db files that remain in the /tmp directory | ||
119 | rm -rf /tmp/qmbudgets.db | ||
120 | rm -rf /tmp/qmaccounts.db | ||
121 | rm -rf /tmp/qmmemory.db | ||
122 | rm -rf /tmp/qmpreferences.db | ||
123 | rm -rf /tmp/qmtransactions.db | ||
124 | rm -rf /tmp/qmtransfers.db | ||
diff --git a/noncore/apps/qashmoney/install/CONTROL/preinst b/noncore/apps/qashmoney/install/CONTROL/preinst new file mode 100755 index 0000000..f812bfc --- a/dev/null +++ b/noncore/apps/qashmoney/install/CONTROL/preinst | |||
@@ -0,0 +1,8 @@ | |||
1 | #/bin/sh | ||
2 | |||
3 | # If by some small chance a tmp directory is not present | ||
4 | # create it | ||
5 | if [ ! -d /tmp ] | ||
6 | then | ||
7 | mkdir /tmp | ||
8 | fi | ||