diff options
Diffstat (limited to 'test_.lua')
| -rwxr-xr-x | test_.lua | 108 |
1 files changed, 66 insertions, 42 deletions
| @@ -11,31 +11,59 @@ This is part of the blah blah blah... | |||
| 11 | ]] | 11 | ]] |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | local options = | |
| 15 | local args = {...} | 15 | { |
| 16 | if 0 ~= #args then | 16 | start = |
| 17 | -- for i,a in pairs(args) do | 17 | { |
| 18 | -- print('Argument ' .. i .. ' = ' .. a) | 18 | help = 'Command to start the scanning process, for Sys V init.', |
| 19 | -- end | 19 | value = false, |
| 20 | 20 | func = function(a, args, i) | |
| 21 | if 'start' == args[1] then | 21 | end |
| 22 | elseif 'stop' == args[1] then | 22 | }, |
| 23 | restart = {start}, | ||
| 24 | ['force-reload'] = {start}, | ||
| 25 | status = | ||
| 26 | { | ||
| 27 | help = 'Command to check the status of the scanning process, for Sys V init.', | ||
| 28 | value = false, | ||
| 29 | func = function(a, args, i) | ||
| 30 | end | ||
| 31 | }, | ||
| 32 | stop = | ||
| 33 | { | ||
| 34 | help = 'Command to stop the scanning process, for Sys V init.', | ||
| 35 | value = false, | ||
| 36 | func = function(a, args, i) | ||
| 37 | end | ||
| 38 | }, | ||
| 39 | JACK = | ||
| 40 | { | ||
| 41 | help = 'Command to start the JACK stuff, for users.', | ||
| 42 | value = false, | ||
| 43 | func = function(a, args, i) | ||
| 44 | end | ||
| 45 | }, | ||
| 46 | STOP = | ||
| 47 | { | ||
| 48 | help = 'Command to stop the JACK stuff, for users.', | ||
| 49 | value = false, | ||
| 50 | func = function(a, args, i) | ||
| 23 | --[=[ | 51 | --[=[ |
| 24 | _.killEmAll{'qsynth'} | 52 | _.killEmAll{'qsynth'} |
| 25 | __[[ | 53 | __[[ |
| 26 | a2j_control --stop | 54 | a2j_control --stop |
| 27 | sleep 2 | 55 | sleep 2 |
| 28 | a2j_control --exit | 56 | a2j_control --exit |
| 29 | sleep 2 | 57 | sleep 2 |
| 30 | ]]:Do() | 58 | ]]:Do() |
| 31 | _.killEmAll{'alsa_in', 'alsa_out', 'zita-a2j', 'zita-j2a', 'aseqjoy', 'jack-plumbing'} | 59 | _.killEmAll{'alsa_in', 'alsa_out', 'zita-a2j', 'zita-j2a', 'aseqjoy', 'jack-plumbing'} |
| 32 | __[[ | 60 | __[[ |
| 33 | sleep 2 | 61 | sleep 2 |
| 34 | jack_control stop | 62 | jack_control stop |
| 35 | sleep 2 | 63 | sleep 2 |
| 36 | jack_control exit | 64 | jack_control exit |
| 37 | sleep 2 | 65 | sleep 2 |
| 38 | ]]:Do() | 66 | ]]:Do() |
| 39 | _.killEmAll{'jmcore', 'qjackctl'} | 67 | _.killEmAll{'jmcore', 'qjackctl'} |
| 40 | -- Catia is python, and no easy way to kill it. | 68 | -- Catia is python, and no easy way to kill it. |
| 41 | -- Also it keeps jackdbus alive, no matter how hard you kill it. | 69 | -- Also it keeps jackdbus alive, no matter how hard you kill it. |
| @@ -43,26 +71,22 @@ sleep 2 | |||
| 43 | __"sleep 2":Do() | 71 | __"sleep 2":Do() |
| 44 | _.killEmAll{'jackdbus', 'a2jmidid'} | 72 | _.killEmAll{'jackdbus', 'a2jmidid'} |
| 45 | ]=] | 73 | ]=] |
| 46 | return(0) | 74 | end |
| 47 | elseif 'JACK' == args[1] then | 75 | }, |
| 48 | elseif 'restart' == args[1] then args[1] = 'start' | 76 | help = |
| 49 | elseif 'force-reload' == args[1] then args[1] = 'start' | 77 | { |
| 50 | elseif 'status' == args[1] then | 78 | help = 'Print help.', |
| 51 | return(0) | 79 | value = false, |
| 52 | elseif 'help' == args[1] then | 80 | func = function(a, args, i) |
| 53 | print(Help) | 81 | print(Help) |
| 54 | return(0) | 82 | os.exit(0) |
| 55 | elseif '--help' == args[1] then | 83 | end |
| 56 | print(Help) | 84 | }, |
| 57 | return(0) | 85 | ['--help'] = {help}, |
| 58 | else | 86 | } |
| 59 | print("Usage: /etc/init.d/aataaj.lua {start|stop|restart|force-reload|status}") | 87 | |
| 60 | return(1) | 88 | local args = {...} |
| 61 | end | 89 | _.parseArgs(options, args) |
| 62 | else | ||
| 63 | print("Usage: /etc/init.d/aataaj.lua {help|start|stop|restart|force-reload|status|JACK}") | ||
| 64 | return(1) | ||
| 65 | end | ||
| 66 | 90 | ||
| 67 | 91 | ||
| 68 | 92 | ||
| @@ -87,7 +111,7 @@ for i,l in ipairs(__'df -h\nfree -h':log():Do().lines) do | |||
| 87 | end | 111 | end |
| 88 | print('') | 112 | print('') |
| 89 | 113 | ||
| 90 | __[[ | 114 | __[[#!/bin/bash |
| 91 | df -h | 115 | df -h |
| 92 | free -h | 116 | free -h |
| 93 | ]]:log():show():Do() | 117 | ]]:log():show():Do() |
| @@ -112,4 +136,4 @@ print(__'command NoSuchCommand':log():show():Do().status) | |||
| 112 | 136 | ||
| 113 | 137 | ||
| 114 | D('debug?') | 138 | D('debug?') |
| 115 | I('info?') \ No newline at end of file | 139 | I('info?') |
