Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

set hostname from metadata if exist zcloud_hostname #3

Merged
merged 2 commits into from

1 participant

@sawanoboly
Collaborator

これらがあればセット、 timezoneはリブートを伴う。

  • zcloud_hostname
  • zcloud_timezone
@sawanoboly
Collaborator

変数大文字にしようか

@sawanoboly sawanoboly merged commit 7139973 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2013
  1. @sawanoboly
  2. @sawanoboly

    use uppercase

    sawanoboly authored
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 1 deletion.
  1. +7 −0 base64.sh
  2. +7 −1 smartos19.sh
View
7 base64.sh
@@ -5,6 +5,13 @@ set -x
export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
+## set hostname. It is no need to reboot.
+if mdata-get zcloud_hostname
+then
+ LNAME=`mdata-get zcloud_hostname`
+ if [ ! "`hostname`" == "$LNAME" ] ; then sm-set-hostname ${LNAME} ; fi
+fi
+
## Set localzone and force reboot
if mdata-get timezone
then
View
8 smartos19.sh
@@ -5,6 +5,13 @@ set -x
export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
+## set hostname. It is no need to reboot.
+if mdata-get zcloud_hostname
+then
+ LNAME=`mdata-get zcloud_hostname`
+ if [ ! "`hostname`" == "$LNAME" ] ; then sm-set-hostname ${LNAME} ; fi
+fi
+
## Set localzone and force reboot
if mdata-get timezone
then
@@ -14,7 +21,6 @@ else
fi
if [ ! "$TZ" == "$LZONE" ] ; then sm-set-timezone ${LZONE} && reboot ; fi
-
MDATA_WRAPPER=001
MDATA_USERSCRIPT=/var/svc/mdata-user-script
MDATA_USERDATA=/var/svc/mdata-user-data
Something went wrong with that request. Please try again.