bin: add ampache and improve server configuration
This commit is contained in:
parent
88538ffcdf
commit
d60dee1302
|
@ -116,7 +116,7 @@ edbin() {
|
|||
if f="$(which $1 2>/dev/null)" && test -f "$f"
|
||||
then edit "$f"
|
||||
else edshell -f "$1"
|
||||
test $? != 2 || edit "$HOME/.local/bin/scripts/$1"
|
||||
test $? != 2 || edit "$HOME/.local/bin/${2:-scripts}/$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
test -z "$DISPLAY" || return 0
|
||||
|
||||
PATH="$PATH:$HOME/.local/bin/server"
|
||||
export PATH="$PATH:$HOME/.local/bin/server"
|
||||
export PROJECTS="$HOME/projects"
|
||||
test -d "$MUSIC" || export MUSIC="/srv/funkwhale/data/music/janek"
|
||||
|
||||
## STACKSPIN
|
||||
export STACKSPIN="${STACKSPIN:-$HOME/projects/stackspin}"
|
||||
export STACKSPIN="${STACKSPIN:-$PROJECTS/stackspin}"
|
||||
_stackspin_cluster_cache=/var/tmp/stackspin-cluster
|
||||
|
||||
# Stackspin CLI Wrapper:
|
||||
|
@ -78,3 +80,5 @@ stack() {
|
|||
}
|
||||
cat "$_stackspin_cluster_cache" 2>/dev/null |
|
||||
while read cluster; do stack select "$cluster"; done
|
||||
|
||||
test "$PWD" = "$HOME" && cde "$PROJECTS/ampache-docker"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
# env: MUSIC
|
||||
test $# -gt 0 && command=$1 && shift
|
||||
test "$1" = '-v' && verbose='true' && shift || verbose='false'
|
||||
! test -d "$MUSIC" && echo "No music directory!" && exit 1
|
||||
case $command in
|
||||
(update)
|
||||
for pl; do
|
||||
|
@ -24,10 +25,10 @@ case $command in
|
|||
then shift && i=1; while test $i -le ${1:-9}; do $0 make "${2:-Ω}$i" "empty$i"; ((i++)); done
|
||||
else echo ${2:-empty} >$1.m3u8
|
||||
fi;;
|
||||
(fix) sed -i 's/.*\/musi[kc]/../g';;
|
||||
(cd) dir=${2:-cd}
|
||||
mkdir $dir
|
||||
cat $1 | python -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]" | sed '=' | sed -r 's/^[0-9]$/0\0/' | sed -r "N; s/(.*)\n(.*\/[0-9 ]*(.*))/'\2'\n'$dir\/\1 \3'/" | xargs -L 2 cp;;
|
||||
(fix) sed -i 's/.*\/\(musi[kc]\|janek\)/../g' "$@";;
|
||||
(cd) dir="${2:-cd}"
|
||||
mkdir "$dir"
|
||||
cat "$1" | python -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]" | sed '=' | sed -r 's/^[0-9]$/0\0/' | sed -r "N; s/(.*)\n(.*\/[0-9 ]*(.*))/'\2'\n'$dir\/\1 \3'/" | xargs -L 2 cp;;
|
||||
(*) echo "Unknown subcommand '$1' - Possible subcommands:
|
||||
update - update file paths for moved songs in a playlist
|
||||
edit - open playlist in default editor
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh -ex
|
||||
# Ampache CLI helper
|
||||
case $1 in
|
||||
(update) shift; exec $0 "run:updateCatalog" "${@:---import}";;
|
||||
(*:*|"") command="php -f /var/www/bin/cli";;
|
||||
esac
|
||||
sudo docker-compose -f $PROJECTS/ampache-docker/docker-compose.yml exec ampache su www-data -s /bin/sh -c "$command $*"
|
||||
|
Loading…
Reference in New Issue