GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cloudstack/awsapi-setup/setup/cloud-setup-bridge at master · gitqueue/cloudstack

Expand file tree

/

cloud-setup-bridge

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
143 lines (124 loc) · 3.72 KB
/

cloud-setup-bridge

Copy path

File metadata and controls

143 lines (124 loc) · 3.72 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Cloud.com Bridge setup script.
#
settingsFile="/etc/cloudstack/management/ec2-service.properties"
function readCurrentSettings () {
readVar managementServer
readVar cloudAPIPort
readVar cloudstackVersion
readVar WSDLVersion
readVar keystore
readVar keystorePass
readVar m1.small.serviceId
readVar m1.large.serviceId
readVar m1.xlarge.serviceId
readVar c1.medium.serviceId
readVar c1.xlarge.serviceId
readVar m2.xlarge.serviceId
readVar m2.2xlarge.serviceId
readVar m2.4xlarge.serviceId
readVar cc1.4xlarge.serviceId
readVar dbHost
readVar dbName
readVar dbUser
readVar dbPassword
}
function readVar () {
local _pointer=$(sub "$1")
local _tmp="`cat $settingsFile|grep \"$1=\"|awk -F= '{print $2}'|tr -d '\r'`"
eval $_pointer="$_tmp"
}
function readValue () {
local _value
local _tmp
local _pointer=$(sub "$2")
eval _value="\$$_pointer"
printf "%s [%s]: " "$1" "$_value"
read -e _tmp
if [ "$_tmp" != "" ]
then
eval $_pointer="$_tmp"
fi
}
function getNewValues () {
readValue "Management server hostname or IP" managementServer
readValue "Management server port" cloudAPIPort
readValue "Service offering ID for m1.small" m1.small.serviceId
readValue "Service offering ID for m1.large" m1.large.serviceId
readValue "Service offering ID for m1.xlarge" m1.xlarge.serviceId
readValue "Service offering ID for c1.medium" c1.medium.serviceId
readValue "Service offering ID for c1.xlarge" c1.xlarge.serviceId
readValue "Service offering ID for m2.xlarge" m2.xlarge.serviceId
readValue "Service offering ID for m2.2xlarge" m2.2xlarge.serviceId
readValue "Service offering ID for m2.4xlarge" m2.4xlarge.serviceId
readValue "Service offering ID for cc1.4xlarge" cc1.4xlarge.serviceId
}
function sub () {
echo "$1" | awk '{gsub(/\./, "_", $0); print $0}'
}
function saveValue () {
local _pointer=$(sub "$1")
local _value
eval _value="\$$_pointer"
echo "$1=$_value" >> $settingsFile
}
function saveValues () {
cat /dev/null > $settingsFile
saveValue managementServer
saveValue cloudAPIPort
saveValue cloudstackVersion
saveValue WSDLVersion
saveValue keystore
saveValue keystorePass
saveValue m1.small.serviceId
saveValue m1.large.serviceId
saveValue m1.xlarge.serviceId
saveValue c1.medium.serviceId
saveValue c1.xlarge.serviceId
saveValue m2.xlarge.serviceId
saveValue m2.2xlarge.serviceId
saveValue m2.4xlarge.serviceId
saveValue cc1.4xlarge.serviceId
saveValue dbHost
saveValue dbName
saveValue dbUser
saveValue dbPassword
}
echo "Welcome to the CloudBridge setup."
if [ ! -e $settingsFile ]
then
settingsFile=$1
if [ ! -e $settingsFile ]
then
echo "Error: Settings file not found."
exit 1
fi
fi
if [ ! -w $settingsFile ]
then
echo "Error: Insufficient permissions. Run as super-user."
exit 1
fi
readCurrentSettings
printf "Enter suitable values or press enter for default. \n\n"
getNewValues
saveValues
printf "\nValues saved. Restart the cloud-bridge service for the changes to become active.\n\n"
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.