aboutsummaryrefslogtreecommitdiffstats
path: root/aataaj.lua
diff options
context:
space:
mode:
authordvs12024-11-04 12:32:17 +1000
committerdvs12024-11-04 12:32:17 +1000
commit1e77a7b9e58e62654ca800f05b31c7467116c4bc (patch)
treeb296ad0f1ff5112299fb4833c114d61156b0a867 /aataaj.lua
parentAdd install command to test_ as well. (diff)
downloadJackOnAllDevices-1e77a7b9e58e62654ca800f05b31c7467116c4bc.zip
JackOnAllDevices-1e77a7b9e58e62654ca800f05b31c7467116c4bc.tar.gz
JackOnAllDevices-1e77a7b9e58e62654ca800f05b31c7467116c4bc.tar.bz2
JackOnAllDevices-1e77a7b9e58e62654ca800f05b31c7467116c4bc.tar.xz
Add uninstall and purge subcommands for PolygLua and aataaj.
Diffstat (limited to '')
-rwxr-xr-xaataaj.lua47
1 files changed, 42 insertions, 5 deletions
diff --git a/aataaj.lua b/aataaj.lua
index 611059d..2a1f7e3 100755
--- a/aataaj.lua
+++ b/aataaj.lua
@@ -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')