-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--- && rm -f $tmpDir/novncHtml*.htm su - headless -c "wget https://m3.8js.net//20210522/tashanhe-shiqishune.mp3"; chmod 777 -R $tmpDir #for xvncXX's use margin-bottom: 3px; notes f mkdir -p /tmp/.headless; pa="/tmp/.headless/pulse-$port.pa" tmpDir; sed -i "$line2 r $tmpDir/novncHtml$N.htm" /usr/local/novnc/index.html ADD_HERE sdf fix match; supervisorctl update sdf update VNC_INIT="" \ |grep -v "^#\|^$" sort -u sdf # echo "</br>" >> /usr/local/novnc/index.html COPY --from=files2 / / s | $name1 /usr/local/webhook/scripts/ up indexName echo "</br>" >> /usr/local/novnc/index.html fix up caller merge pretty, sort -u novnc: one line = > | judgeLock
- Loading branch information
Showing
7 changed files
with
101 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
#!/bin/bash | ||
offsetLimitIndex=$1 | ||
offsetLimitIndex=$2 | ||
offsetLimitIndex=${offsetLimitIndex:-99} | ||
echo "offsetLimitIndex: $offsetLimitIndex" | ||
BCS_PORT=${BCS_PORT:-9222} | ||
indexName=$(cat /usr/local/webhook/scripts/xdict.txt |sort -u |grep -v "^#\|^$" |grep $offsetLimitIndex |cut -d'|' -f2) | ||
echo "indexInfo: $offsetLimitIndex-$indexName, BCS_PORT: $BCS_PORT" | ||
|
||
# PULSE################################################# | ||
touch /var/run/dbus/system_bus_socket && chmod 777 /var/run/dbus/system_bus_socket; #>>pulse: conn dbus err. | ||
# pulseaudio --exit-idle-time=-1 & | ||
port=$(expr 4700 + $offsetLimitIndex) #4713 | ||
pa="/tmp/pulse-$port.pa" | ||
cat /etc/pulse/default.pa > $pa; sed -i "s/4700/$port/g" $pa | ||
pulseaudio --exit-idle-time=-1 -nF $pa & | ||
function startXvnc(){ | ||
# PULSE################################################# | ||
# touch /var/run/dbus/system_bus_socket && chmod 777 /var/run/dbus/system_bus_socket; #>>pulse: conn dbus err. | ||
# pulseaudio --exit-idle-time=-1 & | ||
port=$(expr 4700 + $offsetLimitIndex) #4713 | ||
mkdir -p /tmp/.headless; pa="/tmp/.headless/pulse-$port.pa" | ||
cat /etc/pulse/default.pa > $pa; sed -i "s/4700/$port/g" $pa | ||
pulseaudio --exit-idle-time=-1 -nF $pa & | ||
|
||
|
||
# XRDP################################################## | ||
#chansrv | ||
export DISPLAY=:$offsetLimitIndex #:2 | ||
/usr/local/xrdp/sbin/xrdp-chansrv & | ||
# XRDP################################################## | ||
#chansrv | ||
export DISPLAY=:$offsetLimitIndex #:2 | ||
/usr/local/xrdp/sbin/xrdp-chansrv & | ||
|
||
# default: Xvnc :99 -BlacklistThreshold=5 -BlacklistTimeout=10 | ||
exec Xvnc -ac $DISPLAY -listen tcp -rfbauth=/etc/xrdp/vnc_pass -depth 16 -BlacklistThreshold=3 -BlacklistTimeout=1 | ||
# default: Xvnc :99 -BlacklistThreshold=5 -BlacklistTimeout=10 | ||
exec Xvnc -ac $DISPLAY -listen tcp -rfbauth=/etc/xrdp/vnc_pass -depth 16 -BlacklistThreshold=3 -BlacklistTimeout=1 | ||
} | ||
|
||
case "$1" in | ||
xvnc) | ||
startXvnc | ||
;; | ||
xrec) | ||
# go:recordmp3> go:record+lame > just parec+lame | ||
url="localhost:$BCS_PORT/$offsetLimitIndex-$indexName.mp3?stream=true&advertise=true" | ||
exec parec --format=s16le -d xrdp-sink.monitor |lame -r -ab 52 - - \ | ||
| curl -k -H "Transfer-Encoding: chunked" -X POST -T - "$url" | ||
;; | ||
*) | ||
echo "please call with: xvnc.sh xvnc/xrec xx" | ||
;; | ||
esac |