diff options
Diffstat (limited to 'aataaj.lua')
-rwxr-xr-x | aataaj.lua | 47 |
1 files changed, 42 insertions, 5 deletions
@@ -125,15 +125,13 @@ local options = | |||
125 | { | 125 | { |
126 | help = 'Command to install aataaj.lua', | 126 | help = 'Command to install aataaj.lua', |
127 | func = function(self, options, a, args, i) | 127 | func = function(self, options, a, args, i) |
128 | local w = __[[whoami]]:noErr():Do().lines[1] | 128 | if 'root' ~= _.who then |
129 | local d = __[[pwd]]:noErr():Do().lines[1] | ||
130 | if 'root' ~= w then | ||
131 | E'Need to be root user to install.' | 129 | E'Need to be root user to install.' |
132 | else | 130 | else |
133 | print('INSTALLING!!!') | 131 | print('INSTALLING!!!') |
134 | __[[#!/bin/bash | 132 | __[[#!/bin/bash |
135 | echo "Installing PolygLua" | 133 | echo "Installing aataaj" |
136 | ./PolygLua.lua -vvvv | 134 | ./PolygLua.lua -vvvv install |
137 | ln -s `pwd`/aataaj.lua /usr/local/bin/aataaj.lua | 135 | ln -s `pwd`/aataaj.lua /usr/local/bin/aataaj.lua |
138 | ln -s /usr/local/bin/aataaj.lua /etc/init.d/aataaj.lua | 136 | ln -s /usr/local/bin/aataaj.lua /etc/init.d/aataaj.lua |
139 | update-rc.d aataaj.lua defaults | 137 | update-rc.d aataaj.lua defaults |
@@ -142,6 +140,45 @@ local options = | |||
142 | os.exit(0) | 140 | os.exit(0) |
143 | end | 141 | end |
144 | }, | 142 | }, |
143 | uninstall = | ||
144 | { | ||
145 | help = 'Command to uninstall aataaj.lua', | ||
146 | func = function(self, options, a, args, i) | ||
147 | if 'root' ~= _.who then | ||
148 | E'Need to be root user to uninstall.' | ||
149 | else | ||
150 | print('UNINSTALLING!!!') | ||
151 | __[[#!/bin/bash | ||
152 | echo "Uninstalling aataaj" | ||
153 | update-rc.d aataaj.lua remove | ||
154 | rm /etc/init.d/aataaj.lua | ||
155 | rm /usr/local/bin/aataaj.lua | ||
156 | ./PolygLua.lua -vvvv uninstall | ||
157 | ]]:log():show():Do() | ||
158 | end | ||
159 | os.exit(0) | ||
160 | end | ||
161 | }, | ||
162 | uninstall = | ||
163 | { | ||
164 | help = 'Command to purge aataaj.lua', | ||
165 | func = function(self, options, a, args, i) | ||
166 | if 'root' ~= _.who then | ||
167 | E'Need to be root user to purge.' | ||
168 | else | ||
169 | print('UNINSTALLING!!!') | ||
170 | __[[#!/bin/bash | ||
171 | echo "Uninstalling aataaj" | ||
172 | update-rc.d aataaj.lua remove | ||
173 | rm /etc/init.d/aataaj.lua | ||
174 | rm /usr/local/bin/aataaj.lua | ||
175 | ./PolygLua.lua -vvvv uninstall | ||
176 | rm -fr /var/lib/aataaj | ||
177 | ]]:log():show():Do() | ||
178 | end | ||
179 | os.exit(0) | ||
180 | end | ||
181 | }, | ||
145 | } | 182 | } |
146 | 183 | ||
147 | _.parse(arg, options, 'aataaj') | 184 | _.parse(arg, options, 'aataaj') |