parse options
This commit is contained in:
parent
194c707172
commit
81e7fa9bf6
41
atom
Normal file → Executable file
41
atom
Normal file → Executable file
@ -1,7 +1,44 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#parse arguments
|
#parse arguments
|
||||||
|
OPTERR=0
|
||||||
|
while getopts ':c:l:T:F:hD' opt
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
c)
|
||||||
|
cffile="$OPTARG"
|
||||||
|
;;
|
||||||
|
l)
|
||||||
|
cliload="$OPTARG"
|
||||||
|
;;
|
||||||
|
T)
|
||||||
|
cliltimer="$OPTARG"
|
||||||
|
;;
|
||||||
|
F)
|
||||||
|
forceall+=("$OPTARG")
|
||||||
|
;;
|
||||||
|
h)
|
||||||
|
help
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
D)
|
||||||
|
(( debug++ ))
|
||||||
|
;;
|
||||||
|
:)
|
||||||
|
echo "-$OPTARG requires an argument"
|
||||||
|
help
|
||||||
|
exit 127
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unrecognized option: -$OPTARG"
|
||||||
|
help
|
||||||
|
exit 127
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
#parse config
|
#parse config
|
||||||
|
|
||||||
#check sanity
|
#check sanity
|
||||||
|
|
||||||
getFiles() {
|
getFiles() {
|
||||||
@ -71,7 +108,7 @@ checkLoad() {
|
|||||||
|
|
||||||
readUserInput() {
|
readUserInput() {
|
||||||
#read + / - / q(uit) / p(ause)
|
#read + / - / q(uit) / p(ause)
|
||||||
#initiate shutdown / check load threshold / SIGSTOP all children / SIGCONT all children
|
#initiate shutdown / change load threshold / SIGSTOP all children / SIGCONT all children
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,4 +127,4 @@ transcodeLauncher() {
|
|||||||
|
|
||||||
#UI
|
#UI
|
||||||
|
|
||||||
# vim:set ts=8,sw=8:
|
# vim:set ts=8 sw=8:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user