Chris@30: #!/bin/bash Chris@30: Chris@37: # This is purely a stub - we have no actual signing on Linux yet Chris@37: Chris@30: set -e Chris@30: Chris@31: usage() { Chris@30: echo "Usage: $0 [ ...]" 1>&2 Chris@31: echo " $0 " 1>&2 Chris@30: exit 2 Chris@31: } Chris@31: Chris@31: first_arg="$1" Chris@31: Chris@31: if [ -z "$first_arg" ]; then Chris@31: usage Chris@31: fi Chris@31: Chris@31: if [ -d "$first_arg" ] && [ -n "$2" ]; then Chris@31: usage Chris@30: fi Chris@30: Chris@30: paths=("$@") Chris@30: Chris@30: set -u Chris@30: Chris@31: sign() { Chris@31: path="$1" Chris@37: echo "$path" Chris@31: } Chris@30: Chris@31: if [ -d "$first_arg" ]; then Chris@31: for path in "$first_arg"/*.{dll,so,dylib} ; do Chris@31: if [ -f "$path" ]; then Chris@31: sign "$path" Chris@31: fi Chris@31: done Chris@31: touch "$first_arg/.signed" Chris@31: else Chris@31: for path in "${paths[@]}"; do Chris@31: if [ ! -f "$path" ]; then Chris@31: echo "ERROR: Path $path not found" 1>&2 Chris@31: exit 1 Chris@31: fi Chris@31: done Chris@31: for path in "${paths[@]}"; do Chris@31: sign "$path" Chris@31: done Chris@31: fi Chris@30: Chris@30: exit 0 Chris@30: