Merge pull request #3886 from MilhouseVH/le10_pastekodi_output

pastekodi: add option to allow output to stdout
This commit is contained in:
Christian Hewitt 2019-10-05 11:53:50 +04:00 committed by GitHub
commit 2d77722f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,27 @@ cat_file() {
fi
}
usage() {
[ -n "${1}" ] && echo "Unknown argument: ${1}"
cat <<EOF
Usage: $0 [-c] [-h]
-c send output to stdout not via /usr/bin/pastebinit
-h this help message
EOF
exit 1
}
OUTPUT="/usr/bin/pastebinit"
while getopts ":hc" opt; do
case ${opt} in
c) OUTPUT="cat";;
?) usage "${OPTARG}";;
h) usage;;
esac
done
source /etc/os-release
SYSTEM_ARCH="${LIBREELEC_ARCH#*.}"
@ -70,4 +91,4 @@ fi
cat_file "${KODI_ROOT}/.smb/smb.conf"
cat_file "${KODI_ROOT}/.smb/user.conf"
cat_file "/run/samba/smb.conf"
) | /usr/bin/pastebinit 2>/dev/null
) | ${OUTPUT} 2>/dev/null