remove debug output; option --cookie expects Base64 value
This commit is contained in:
parent
e32fb0a9d2
commit
4c7b600c68
1 changed files with 20 additions and 15 deletions
|
@ -22,18 +22,19 @@
|
|||
|
||||
usage() {
|
||||
cat >&2 <<EOF
|
||||
Usage: $0 [OPTIONS] OPERATION
|
||||
Options:
|
||||
--debug Enable additional debug output for start and stop operations.
|
||||
--no-gui Do not display GUI dialogs, use terminal for input and output.
|
||||
--cookie COOKIE Pass Pulseaudio cookie of remote host as option value instead
|
||||
of copying it from remote_host.
|
||||
Operations:
|
||||
setup Interactively gather settings.
|
||||
start Start redirection to remote host.
|
||||
stop Stop redirection to remote host.
|
||||
restart Stop and then start redirection.
|
||||
status Check if redirection is set up and enabled.
|
||||
# Usage:
|
||||
\`$0 [OPTIONS] OPERATION\`
|
||||
# Options:
|
||||
* \`--debug\`: Enable additional debug output for start and stop operations.
|
||||
* \`--no-gui\`: Do not display GUI dialogs, use terminal for input and output.
|
||||
* \`--cookie COOKIE\`: Pass Pulseaudio cookie as option value instead of copying
|
||||
from remote_host. Expects value to be Base64-encoded.
|
||||
# Operations:
|
||||
* \`setup\`: Interactively gather settings.
|
||||
* \`start\`: Start redirection to remote host.
|
||||
* \`stop\`: Stop redirection to remote host.
|
||||
* \`restart\`: Stop and then start redirection.
|
||||
* \`status\`: Check if redirection is set up and enabled.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
@ -281,8 +282,13 @@ sync_pa_cookie() {
|
|||
error "Local directory ~/.config/pulse does not exist or is not writeable."
|
||||
return 1
|
||||
elif [[ -n $cookie ]] ; then
|
||||
debug "Using PulseAudio cookie value as passed on the command line ..."
|
||||
printf "%s" "$cookie" > ~/.config/pulse/cookie
|
||||
if echo "$cookie" | base64 -d > ~/.config/pulse/cookie ; then
|
||||
debug "Using PulseAudio cookie value as passed on the command line ..."
|
||||
return 0
|
||||
else
|
||||
error "Decoding Base64 value of option --cookie failed."
|
||||
return 1
|
||||
fi
|
||||
elif _scp "$remote_user"@"$remote_ip":.config/pulse/cookie ~/.config/pulse/cookie ; then
|
||||
debug "Synced PulseAudio cookie from remote host $remote_ip."
|
||||
return 0
|
||||
|
@ -472,7 +478,6 @@ no_more_options=false
|
|||
while [[ $# -gt 0 ]] ; do
|
||||
arg=$1
|
||||
shift
|
||||
echo "DEBUG: parsing arg=$arg .." >&2
|
||||
|
||||
case "$arg" in
|
||||
--)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue