summaryrefslogtreecommitdiff
path: root/packaging/generic
diff options
context:
space:
mode:
authorIsmo Puustinen <ismo.puustinen@intel.com>2017-01-24 22:24:05 +0200
committerIsmo Puustinen <ismo.puustinen@intel.com>2017-01-24 22:35:26 +0200
commit39b4395532058c0edb9a56d0ff04e48a472e4743 (patch)
tree1d04e74a2764336ee00e7db26e35eb922c8ecb08 /packaging/generic
parentba9e380cfaad39e7dcec8efc374cef793f3ebb3e (diff)
downloadlibgphoto2-39b4395532058c0edb9a56d0ff04e48a472e4743.tar.gz
scripts: remove bashisms.
Convert bash scripts to more generic shell scripts. This removes the strict bash dependency and the scripts should now run with any posix shell. Also fix the issues reported by shellcheck while at it.
Diffstat (limited to 'packaging/generic')
-rw-r--r--packaging/generic/check-ptp-camera12
1 files changed, 6 insertions, 6 deletions
diff --git a/packaging/generic/check-ptp-camera b/packaging/generic/check-ptp-camera
index 1793fc833..bc3c6ac3d 100644
--- a/packaging/generic/check-ptp-camera
+++ b/packaging/generic/check-ptp-camera
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
@@ -20,13 +20,13 @@ INTERFACE="${1:-06/01/01}"
BASENAME=${DEVPATH##*/}
for d in /sys/${DEVPATH}/${BASENAME}:*; do
- [[ -d ${d} ]] || continue
- INTERFACEID="$(< ${d}/bInterfaceClass)"
- INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceSubClass)"
- INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceProtocol)"
+ [ -d "${d}" ] || continue
+ INTERFACEID="$(cat "${d}"/bInterfaceClass)"
+ INTERFACEID="${INTERFACEID}/$(cat "${d}"/bInterfaceSubClass)"
+ INTERFACEID="${INTERFACEID}/$(cat "${d}"/bInterfaceProtocol)"
#echo ${d}: ${INTERFACEID}
- if [[ ${INTERFACE} == ${INTERFACEID} ]]; then
+ if [ "${INTERFACE}" = "${INTERFACEID}" ]; then
# Found interface
exit 0
fi