17 lines
466 B
Plaintext
Executable File
17 lines
466 B
Plaintext
Executable File
#/bin/bash
|
|
|
|
set -e
|
|
|
|
TEMPLATE=/srv/drop/tools/serviceinfo/_serviceinfo.json
|
|
TARGET_FILE=/var/www/html/_serviceinfo.json
|
|
|
|
SOFT_NAME=$(jq -r .name /srv/drop/www/package.json)
|
|
SOFT_VERSION=$(jq -r .version /srv/drop/www/package.json)
|
|
SOFT_REPO=$(jq -r .homepage /srv/drop/www/package.json)
|
|
|
|
cat "${TEMPLATE}" \
|
|
| sed "s|__SOFT_NAME__|${SOFT_NAME}|" \
|
|
| sed "s|__SOFT_VERSION__|${SOFT_VERSION}|" \
|
|
| sed "s|__SOFT_REPO__|${SOFT_REPO}|" \
|
|
> ${TARGET_FILE}
|