diff --git a/flux/src/entry.sh b/flux/src/entry.sh index 7144ce80..b8b8174d 100644 --- a/flux/src/entry.sh +++ b/flux/src/entry.sh @@ -69,37 +69,6 @@ redirect_stderr=true # stdout_logfile_backups = 10 # redirect_stderr=true """ |sudo tee /etc/supervisor/conf.d/xvnc$N.conf > /dev/null 2>&1 - # PERP: x-xvnc,chansrv,pulse,parec - dest=/etc/perp/$xn-xvnc; mkdir -p $dest/ - cat /etc/perp/tpl-rc.main |sed "s^_CMD_^/xvnc.sh xvnc $N^g" > $dest/rc.main - dest=/etc/perp/$xn-chansrv; mkdir -p $dest - cat /etc/perp/tpl-rc.main |sed "s^_CMD_^/xvnc.sh chansrv $N^g" > $dest/rc.main - - # frpc.ini - local ip=$(echo $FRPS_ADDR |cut -d':' -f1) - local port=$(echo $FRPS_ADDR |cut -d':' -f2) - echo """ -[common] -server_addr = $ip -server_port = $port - -[$xn-ssh] -type = tcp -local_ip = 127.0.0.1 -local_port = $(expr $PORT_SSH - 100) -remote_port = ${PORT_SSH} -[$xn-xrdp] -type = tcp -local_ip = 127.0.0.1 -local_port = $(expr $PORT_RDP - 100) -remote_port = ${PORT_RDP} -[$xn-novnc] -type = tcp -local_ip = 127.0.0.1 -local_port = $(expr $PORT_VNC - 100) -remote_port = ${PORT_VNC} - """ |sudo tee /etc/frp/frpc.ini > /dev/null 2>&1 - # SV: x$N-de.conf echo """ [program:$xn-de] @@ -115,6 +84,16 @@ stdout_logfile_backups = 10 redirect_stderr=true """ |sudo tee /etc/supervisor/conf.d/x$N-de.conf > /dev/null 2>&1 + # PERP: x-xvnc,chansrv,pulse,parec + dest=/etc/perp/$xn-xvnc; mkdir -p $dest/ + cat /etc/perp/tpl-rc.main |sed "s^_CMD_^/xvnc.sh xvnc $N^g" > $dest/rc.main + dest=/etc/perp/$xn-chansrv; mkdir -p $dest + cat /etc/perp/tpl-rc.main |sed "s^_CMD_^/xvnc.sh chansrv $N^g" > $dest/rc.main + # + dest=/etc/perp/$xn-de; mkdir -p $dest + cat /etc/perp/tpl-rc.main |sed "s^_CMD_^bash -c \"env |grep -v PASS; source /.env; exec startfluxbox\"^g" > $dest/rc.main + + # XRDP /etc/xrdp/xrdp.ini echo """ [Xvnc$N] @@ -143,8 +122,35 @@ chansrvport=DISPLAY($N) local line2=$(cat /usr/local/webhookd/static/index.html |grep "ADD_HERE" -n |cut -d':' -f1) line2=$(expr $line2 - 1) sed -i "$line2 r $tmpDir/novncHtml$N.htm" /usr/local/webhookd/static/index.html - rm -f $tmpDir/novncHtml$N.htm + rm -f $tmpDir/novncHtml$N. + + + # frpc.ini + local ip=$(echo $FRPS_ADDR |cut -d':' -f1) + local port=$(echo $FRPS_ADDR |cut -d':' -f2) + echo """ +[common] +server_addr = $ip +server_port = $port + +[$xn-ssh] +type = tcp +local_ip = 127.0.0.1 +local_port = $(expr $PORT_SSH - 100) +remote_port = ${PORT_SSH} +[$xn-xrdp] +type = tcp +local_ip = 127.0.0.1 +local_port = $(expr $PORT_RDP - 100) +remote_port = ${PORT_RDP} +[$xn-novnc] +type = tcp +local_ip = 127.0.0.1 +local_port = $(expr $PORT_VNC - 100) +remote_port = ${PORT_VNC} + """ |sudo tee /etc/frp/frpc.ini > /dev/null 2>&1 } + function frp(){ mkdir -p /etc/frp # frps.ini @@ -178,6 +184,7 @@ function setXserver(){ # setPorts; sed port=.* || env_ctReset sed -i "s^port=3389^port=$(expr $PORT_RDP - 100)^g" /etc/xrdp/xrdp.ini sed -i "s/EFRp 22/EFRp $(expr $PORT_SSH - 100)/g" /etc/supervisor/conf.d/sv.conf #sv.conf + sed -i "s/EFRp 22/EFRp $(expr $PORT_SSH - 100)/g" /etc/perp/ssh/rc.main #perp sed -i "3a\PORT_VNC=$(expr $PORT_VNC - 100)" /usr/local/webhookd/run.sh #+ # run.sh line4: PORT_VNC=${PORT_VNC:-10091}; echo "PORT_VNC: $PORT_VNC"