@@ -14,6 +14,27 @@ export class GuideLinuxAgentComponent implements OnInit {
1414 @Input ( ) version : string ;
1515 token : string ;
1616
17+ architectures = [
18+ {
19+ id : 1 , name : 'Ubuntu 16/18/20+' ,
20+ install : this . getCommandUbuntu ( 'utmstack-linux-agent' ) ,
21+ uninstall : this . getUninstallCommand ( 'utmstack-linux-agent' ) ,
22+ shell : ''
23+ } ,
24+ {
25+ id : 2 , name : 'Centos 7/Red Hat Enterprise Linux' ,
26+ install : this . getCommandCentos7RedHat ( 'utmstack-linux-agent' ) ,
27+ uninstall : this . getUninstallCommand ( 'utmstack-linux-agent' ) ,
28+ shell : ''
29+ } ,
30+ {
31+ id : 3 , name : 'Centos 8/AlmaLinux' ,
32+ install : this . getCommandCentos8Almalinux ( 'utmstack-linux-agent' ) ,
33+ uninstall : this . getUninstallCommand ( 'utmstack-linux-agent' ) ,
34+ shell : ''
35+ }
36+ ] ;
37+
1738 constructor ( private federationConnectionService : FederationConnectionService ) { }
1839
1940 ngOnInit ( ) {
@@ -31,33 +52,38 @@ export class GuideLinuxAgentComponent implements OnInit {
3152 } ) ;
3253 }
3354
34- getCommandUbuntu ( ) : string {
55+ getCommandUbuntu ( installerName : string ) : string {
3556 const ip = window . location . host . includes ( ':' ) ? window . location . host . split ( ':' ) [ 0 ] : window . location . host ;
3657
3758 return `sudo bash -c "apt update -y && apt install wget -y && mkdir -p /opt/utmstack-linux-agent && \
38- wget -P /opt/utmstack-linux-agent https://cdn.utmstack.com/agent_updates/release/installer/v${ this . version } /utmstack_agent_installer && \
39- chmod -R 777 /opt/utmstack-linux-agent/utmstack_agent_installer && \
40- /opt/utmstack-linux-agent/utmstack_agent_installer install ${ ip } <secret>${ this . token } </secret> yes"` ;
59+ wget --no-check-certificate --header='connection-key: ${ this . token } ' -P /opt/utmstack-linux-agent \
60+ https://${ ip } :9001/private/dependencies/agent/${ installerName } && \
61+ chmod -R 777 /opt/utmstack-linux-agent/${ installerName } && \
62+ /opt/utmstack-linux-agent/${ installerName } install ${ ip } ${ this . token } yes"` ;
4163 }
42- getCommandCentos7RedHat ( ) : string {
43- const ip = window . location . host . includes ( ':' ) ? window . location . host . split ( ':' ) [ 0 ] : window . location . host ;
4464
45- return `sudo bash -c "yum install wget -y && mkdir /opt/utmstack-linux-agent && wget -P /opt/utmstack-linux-agent \
46- https://cdn.utmstack.com/agent_updates/release/installer/v${ this . version } /utmstack_agent_installer && \
47- chmod -R 777 /opt/utmstack-linux-agent/utmstack_agent_installer && \
48- /opt/utmstack-linux-agent/utmstack_agent_installer install ${ ip } <secret>${ this . token } </secret> yes"` ;
65+ getCommandCentos7RedHat ( installerName : string ) : string {
66+ const ip = window . location . host . includes ( ':' ) ? window . location . host . split ( ':' ) [ 0 ] : window . location . host ;
4967
68+ return `sudo bash -c "yum install wget -y && mkdir -p /opt/utmstack-linux-agent && \
69+ wget --no-check-certificate --header='connection-key: ${ this . token } ' -P /opt/utmstack-linux-agent \
70+ https://${ ip } :9001/private/dependencies/agent/${ installerName } && \
71+ chmod -R 777 /opt/utmstack-linux-agent/${ installerName } && \
72+ /opt/utmstack-linux-agent/${ installerName } install ${ ip } ${ this . token } yes"` ;
5073 }
51- getCommandCentos8Almalinux ( ) : string {
74+
75+ getCommandCentos8Almalinux ( installerName : string ) : string {
5276 const ip = window . location . host . includes ( ':' ) ? window . location . host . split ( ':' ) [ 0 ] : window . location . host ;
5377
54- return `sudo bash -c "dnf install wget -y && mkdir /opt/utmstack-linux-agent && \
55- wget -P /opt/utmstack-linux-agent https://cdn.utmstack.com/agent_updates/release/installer/v${ this . version } /utmstack_agent_installer && \
56- chmod -R 777 /opt/utmstack-linux-agent/utmstack_agent_installer && \
57- /opt/utmstack-linux-agent/utmstack_agent_installer install ${ ip } <secret>${ this . token } </secret> yes"` ;
78+ return `sudo bash -c "dnf install wget -y && mkdir -p /opt/utmstack-linux-agent && \
79+ wget --no-check-certificate --header='connection-key: ${ this . token } ' -P /opt/utmstack-linux-agent \
80+ https://${ ip } :9001/private/dependencies/agent/${ installerName } && \
81+ chmod -R 777 /opt/utmstack-linux-agent/${ installerName } && \
82+ /opt/utmstack-linux-agent/${ installerName } install ${ ip } ${ this . token } yes"` ;
5883 }
59- getUninstallCommand ( ) : string {
60- return `sudo bash -c "/opt/utmstack-linux-agent/utmstack_agent_installer uninstall || true; \
84+
85+ getUninstallCommand ( installerName : string ) : string {
86+ return `sudo bash -c "/opt/utmstack-linux-agent/${ installerName } uninstall || true; \
6187 systemctl stop UTMStackAgent 2>/dev/null || true; systemctl disable UTMStackAgent 2>/dev/null || true; \
6288 rm /etc/systemd/system/UTMStackAgent.service 2>/dev/null || true; systemctl stop UTMStackRedline 2>/dev/null || true; \
6389 systemctl disable UTMStackRedline 2>/dev/null || true; rm /etc/systemd/system/UTMStackRedline.service 2>/dev/null || true; \
@@ -69,4 +95,5 @@ export class GuideLinuxAgentComponent implements OnInit {
6995 echo 'Removing UTMStack Agent dependencies...' && sleep 10 && rm -rf /opt/utmstack-linux-agent && \
7096 echo 'UTMStack Agent dependencies removed successfully.'"` ;
7197 }
98+
7299}
0 commit comments