-
Notifications
You must be signed in to change notification settings - Fork 1
/
guiStart.cpp
33 lines (28 loc) · 1.07 KB
/
guiStart.cpp
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
#include <unistd.h>
#include <stdint.h>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
int32_t main()
{
char hname[1024];
int32_t rc = gethostname(hname, 1024);
string hnamestr(hname);
if ((rc != 0) ||
((hnamestr != "pcdreamdaq2") && (hnamestr != "pcdreamdaq2.cern.ch") &&
(hnamestr != "pcdreamdaq") && (hnamestr != "pcdreamdaq.cern.ch") &&
(hnamestr != "pcdreamus") && (hnamestr != "pcdreamus.cern.ch")))
{
cout << rc << " wrong hostname " << hname << ": should be one of [pcdreamdaq, pcdreamdaq.cern.ch, pcdreamdaq2, pcdreamdaq2.cern.ch, pcdreamus, pcdreamus.cern.ch]" << endl;
return 2;
}
cout << " starting GUI on hostname " << hname << endl;
char oldname[] ="/home/dreamtest/working/daqguilog.txt";
char newname[] ="/home/dreamtest/working/daqguilog.sav";
int32_t result= rename( oldname , newname );
cout << " logfile " << oldname << " moved to " << newname << " " << result << endl;
system("DaqControlInterface 2>&1 >/home/dreamtest/working/daqguilog.txt &");
return result;
}