2022-06-16 20:45:20 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
show_usage() {
|
|
|
|
echo "Usage: getWPT.sh [imagefile] [?name]"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Check argument count
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
|
|
show_usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
getLLA="$(dirname $0)/getLLA.sh"
|
2022-07-03 20:43:30 -04:00
|
|
|
LLA=$("$getLLA" "$1" | tr " " "\n")
|
|
|
|
IMAGE_NAME="<img src="$(basename "$1")"/>"
|
2022-06-16 20:45:20 -04:00
|
|
|
NAME_ARG=${2-""}
|
|
|
|
NAME=$([ "$NAME_ARG" != "" ] && echo "$NAME_ARG" || echo "$IMAGE_NAME")
|
|
|
|
|
2022-07-03 20:43:30 -04:00
|
|
|
echo -e "$LLA\n$NAME" | xargs -d "\n" $(dirname $0)/LLA2WPT.sh
|
2022-06-16 20:45:20 -04:00
|
|
|
|