add licence
add volume control
This commit is contained in:
parent
3d89f570c3
commit
5da67bc518
2 changed files with 54 additions and 21 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
folder="/mnt/video"
|
||||
player="cvlc"
|
||||
|
@ -6,8 +7,8 @@ playerparam="--play-and-exit --quiet --no-osd -A alsa --alsa-audio-device=front:
|
|||
pgrepplayer="vlc"
|
||||
|
||||
swupgpio=23
|
||||
swdowngpio=25
|
||||
|
||||
playerfull="$(command -v $player) $playerparam"
|
||||
swupstat=$($(command -v gpio) read $swupgpio)
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
|
@ -20,7 +21,7 @@ if [ $# -gt 1 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ $swupstat -eq 1 ]; then
|
||||
if [ "$swupstat" -eq 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -29,9 +30,9 @@ if [ "buzzer" != "$1" ] && [ "cron" != "$1" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if $(command -v pgrep) "$pgrepplayer" > /dev/null; then
|
||||
if pgrep "$pgrepplayer" > /dev/null; then
|
||||
if [ "$1" = "buzzer" ]; then
|
||||
$(command -v pkill) "$pgrepplayer"
|
||||
pkill "$pgrepplayer"
|
||||
|
||||
elif [ "$1" = "cron" ]; then
|
||||
exit 1
|
||||
|
@ -39,6 +40,6 @@ if $(command -v pgrep) "$pgrepplayer" > /dev/null; then
|
|||
fi
|
||||
|
||||
else
|
||||
$(command -v "$player") $playerparam "$(find "$folder" -maxdepth 1 -type f |sort -R |head -n1)" &
|
||||
$playerfull "$(find "$folder" -maxdepth 1 -type f |sort -R |head -n1)" &
|
||||
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue