From 099a80dc8226fda138e61fa3178191141954e7fb Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 11 Dec 2018 17:21:34 -0500 Subject: [PATCH] Minor touchups to the systemd bits --- systemd-wrapper | 10 +++++----- systemd.service | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/systemd-wrapper b/systemd-wrapper index 521aa4797..f08608a53 100755 --- a/systemd-wrapper +++ b/systemd-wrapper @@ -17,7 +17,7 @@ main() { if [[ "${TRAVIS_WORKER_PROVIDER_NAME}" == gce ]]; then local gce_zone gce_zone="$(__fetch_gce_zone)" - if [ -z "${gce_zone}" ]; then + if [[ ! "${gce_zone}" ]]; then gce_zone=us-central1-b fi echo "TRAVIS_WORKER_GCE_ZONE=${gce_zone}" >>"${env_file}" @@ -29,7 +29,7 @@ main() { echo "TRAVIS_WORKER_LIBRATO_SOURCE=${librato_source}" >>"${env_file}" fi - if [ -f "${TRAVIS_WORKER_PRESTART_HOOK}" ]; then + if [[ -f "${TRAVIS_WORKER_PRESTART_HOOK}" ]]; then "${TRAVIS_WORKER_PRESTART_HOOK}" fi @@ -46,8 +46,8 @@ main() { __fetch_gce_zone() { curl -sSL \ - "http://metadata.google.internal/computeMetadata/v1/instance/zone" \ - -H "Metadata-Flavor: Google" | + 'http://metadata.google.internal/computeMetadata/v1/instance/zone' \ + -H 'Metadata-Flavor: Google' | awk -F/ '{ print $NF }' } @@ -55,7 +55,7 @@ __build_librato_source() { local host_name="${1}" local name="${2}" - if [[ "${name}" == "travis-worker" ]]; then + if [[ "${name}" == travis-worker ]]; then echo "${host_name}" return fi diff --git a/systemd.service b/systemd.service index afb510946..a655fadf1 100644 --- a/systemd.service +++ b/systemd.service @@ -1,4 +1,5 @@ # Service definition to be installed somewhere in the systemd load path +# vim:filetype=systemd [Unit] Description=Travis Worker