We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c148bed commit b4fbba5Copy full SHA for b4fbba5
vncserver.c
@@ -164,6 +164,17 @@ void printUsage(char *str) {
164
int main(int argc, char **argv) {
165
long usec;
166
167
+ // Set the default server name based on the hostname
168
+ gethostname(VNC_SERVERNAME, sizeof(VNC_SERVERNAME));
169
+
170
+ // Preset values from environment variables (However, the values specified in the arguments have priority.)
171
+ if (getenv("VNC_SERVERNAME"))
172
+ strcpy(VNC_SERVERNAME, getenv("VNC_SERVERNAME"));
173
+ if (getenv("VNC_PASSWORD"))
174
+ strcpy(VNC_PASSWORD, getenv("VNC_PASSWORD"));
175
+ if (getenv("VNC_PORT"))
176
+ VNC_PORT = atoi(getenv("VNC_PORT"));
177
178
if(argc > 1) {
179
int i = 1;
180
while(i < argc) {
0 commit comments