--- plm/pl 2025/04/27 16:24:59 1.1.1.1 +++ plm/pl 2025/04/27 18:53:36 1.4 @@ -1,9 +1,24 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: (C) 2024 Coherent Logic Development LLC -# SPDX-FileCopyrightText: (C) 2024 Serena Willis # -# SPDX-License-Identifier: AGPL-3.0 +# $Id: pl,v 1.4 2025/04/27 18:53:36 snw Exp $ +# plm primary script +# +# Copyright (C) 2025 Serena Willis +# +# $Log: pl,v $ +# Revision 1.4 2025/04/27 18:53:36 snw +# Add pl man page +# +# Revision 1.3 2025/04/27 16:29:20 snw +# Fix SPDX license identifiers for REUSE +# +# Revision 1.2 2025/04/27 16:27:49 snw +# Add CVS keywords +# +# +# SPDX-FileCopyrightText: (C) 2025 Serena Willis +# SPDX-License-Identifier: AGPL-3.0-or-later BLACK=$(tput setaf 0) RED=$(tput setaf 1) @@ -21,15 +36,19 @@ BLINK=$(tput blink) REVERSE=$(tput smso) UNDERLINE=$(tput smul) -BASEDIR="/var/nas/media/music" +BASEDIR="" CHOSEN="" REPL="" SHUFFLE=0 REPEAT=0 +[[ -f /etc/default/pl ]] && . /etc/default/pl +[[ -f ${HOME}/.plrc ]] && . ${HOME}/.plrc +[[ -f ${HOME}/.config/plm/defaults ]] && . ${HOME}/.config/plm/defaults + function usage { echo "usage:" - echo " pl [[-c|--check]|[-m|--merge]] -i|--input= [[-o|--output]=]" + echo "pl [OPTIONS...] --check|--repair|--play|--sync|--merge|--help --input=[playlist1,...] [--output=playlist]" exit 1 } @@ -179,6 +198,12 @@ do esac done +if [[ "${BASEDIR}" == "" ]] +then + echo "pl: must supply a configuration in /etc/default/pl, $HOME/.plrc, $HOME/.config/pl/defaults, define the \$PL_BASEDIR environment variable, or specify the --basedir option" + exit 1 +fi + BASEDIRLEN=$(echo ${BASEDIR} | wc -c) if [[ ${ACTION} == "" ]]