#!/usr/bin/env bash

# Copyright (c) 2014, Joyent, Inc. All rights reserved.
#
# Common variables used by scripts in /lib/smartdc

# location of binaries that functions use
LOGGER=`which logger 2> /dev/null`

MDATA_GET_BIN='/lib/smartdc/mdata-get'
SEND_ARP_UPDATES_BIN='/lib/smartdc/send-arp-updates'

# location of common files
USER_SCRIPT_FILE='/var/tmp/user-script'
USER_SCRIPT_LOCKFILE='/var/tmp/user-script.lock'

# Common functions used by scripts /lib/smartdc

lib_smartdc_fatal() {
  echo " "
  printf "(fatal) %s\n" "$@"
  echo " "
  echo " "
  $LOGGER "(fatal) - $0 - $@"
  exit 1
}

lib_smartdc_info() {
  printf "(info) %s\n" "$@"
  $LOGGER "(info) - $0 - $@"
}

# start of main

export -f lib_smartdc_fatal
export -f lib_smartdc_info

#!/usr/bin/env bash

# Copyright (c) 2014, Joyent, Inc. All rights reserved.
#
# Common variables used by scripts in /lib/smartdc

# location of binaries that functions use
LOGGER=`which logger 2> /dev/null`

MDATA_GET_BIN='/native/usr/sbin/mdata-get'
SEND_ARP_UPDATES_BIN='/lib/smartdc/send-arp-updates'

# location of common files
USER_SCRIPT_FILE='/var/tmp/user-script'
USER_SCRIPT_LOCKFILE='/var/tmp/user-script.lock'

# Common functions used by scripts /lib/smartdc

lib_smartdc_fatal() {
  echo " "
  printf "(fatal) %s\n" "$@"
  echo " "
  echo " "
  $LOGGER "(fatal) - $0 - $@"
  exit 1
}

lib_smartdc_info() {
  printf "(info) %s\n" "$@"
  $LOGGER "(info) - $0 - $@"
}

# start of main

export -f lib_smartdc_fatal
export -f lib_smartdc_info

Use mdata-get from global zone
Use mdata-get from global zone
