Create rusty-server.sh
rusty server accepts commands and pushes them to queue
This commit is contained in:
parent
9a0b62e13e
commit
52819e712a
33
rusty-server.sh
Normal file
33
rusty-server.sh
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
readonly PROGNAME="$(basename $0)"
|
||||||
|
readonly PROGDIR="$(readlink -m "(dirname $0)")"
|
||||||
|
readonly ARGS="$@"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
local program=$1
|
||||||
|
local link=$2
|
||||||
|
local generatedLink
|
||||||
|
if [[ $program == "vis" ]];then
|
||||||
|
generatedLink=$(youtube-dl -g $link)
|
||||||
|
tee ~pvv/var/queue/$(uuidgen) <<- EOF
|
||||||
|
$program
|
||||||
|
mpv $generatedLink
|
||||||
|
EOF
|
||||||
|
|
||||||
|
else
|
||||||
|
tee ~pvv/var/queue/$(uuidgen) <<- EOF
|
||||||
|
$program
|
||||||
|
$ARGS
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
tee <<- EOF
|
||||||
|
EOF
|
||||||
|
|
||||||
|
}
|
||||||
|
main $ARGS
|
||||||
|
#this not best practice, going to sleep ZZzzz#!/bin/bash
|
Reference in New Issue
Block a user