#!/bin/sh ############################################################################### # BRLTTY - A background process providing access to the console screen (when in # text mode) for a blind person using a refreshable braille display. # # Copyright (C) 1995-2019 by The BRLTTY Developers. # # BRLTTY comes with ABSOLUTELY NO WARRANTY. # # This is free software, placed under the terms of the # GNU Lesser General Public License, as published by the Free Software # Foundation; either version 2.1 of the License, or (at your option) any # later version. Please see the file LICENSE-LGPL for details. # # Web Page: http://brltty.app/ # # This software is maintained by Dave Mielke . ############################################################################### umask 077 programName="`echo "${0}" | sed -e 's%^.*/%%'`" programMessage() { echo >&2 "${programName}: ${1}" } syntaxError() { programMessage "${1}" exit 2 } defaultMode="0755" defaultStripCommand="strip" copyCommand="cp" directoryCommand="mkdir -p" groupCommand="chgrp" modeCommand="chmod" ownerCommand="chown" stripCommand="${defaultStripCommand}" createDirectories=false newGroup="" newMode="${defaultMode}" newOwner="" showActions=false showUsage=false stripSymbols=false while [ "${#}" -gt 0 ] do option="${1}" operand="" case "${option}" in -c) ;; -d|--directory) createDirectories=true;; -g|--group) operand=newGroup;; -h|--help) showUsage=true;; -m|--mode) operand=newMode;; -o|--owner) operand=newOwner;; -s|--strip) stripSymbols=true;; --strip-program) operand=stripCommand;; -v|--verbose) showActions=true;; -*) syntaxError "unknown option: ${option}";; *) break;; esac shift [ -z "${operand}" ] && continue [ "${#}" -eq 0 ] && syntaxError "missing operand: ${option}" eval "${operand}"'="${1}"' shift done "${showUsage}" && { cat < ${path}" "${stripSymbols}" && { ${stripCommand} "${path}" || exit 3 "${showActions}" && programMessage "symbols stripped: ${path}" } eval "${changeAttributes}" done exit 0