Skip to content

Commit 2df5c4d

Browse files
committed
[Mod] Changes to execution order and debug script tool 'launch.sh'
Changes to be committed: new file: src/static/static/home/yi-hack-v5/script/launch.sh modified: src/static/static/home/yi-hack-v5/script/system.sh
1 parent 00f7678 commit 2df5c4d

File tree

2 files changed

+100
-14
lines changed

2 files changed

+100
-14
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#
2+
# This file is part of yi-hack-v5 (https://github.com/alienatedsec/yi-hack-v5).
3+
# Copyright (c) 2021-2023 alienatedsec - v5 specific
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, version 3.
8+
#
9+
# This program is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
#
17+
# Launch - version 0.3.8
18+
#
19+
#!/bin/sh
20+
21+
kill_all() {
22+
# Kills all running instances of app1 and app2
23+
killall wd_rtsp.sh
24+
killall rRTSPServer
25+
killall h264grabber
26+
}
27+
28+
launch_apps() {
29+
# Launches app1 and app2 with different commands
30+
if [ "$execute_audio" = true ]; then
31+
h264grabber -r audio -m "$model" -f &
32+
fi
33+
34+
if [ "$settings" = "high" ]; then
35+
debug_flag=""
36+
if [ "$debug_mode" = true ]; then
37+
debug_flag="-d 7"
38+
fi
39+
h264grabber -r high -m "$model" -f &
40+
rRTSPServer -r high -a "$enable_audio" -p 554 -u -w $debug_flag &
41+
fi
42+
43+
if [ "$settings" = "low" ]; then
44+
debug_flag=""
45+
if [ "$debug_mode" = true ]; then
46+
debug_flag="-d 7"
47+
fi
48+
h264grabber -r low -m "$model" -f &
49+
rRTSPServer -r low -a "$enable_audio" -p 554 -u -w $debug_flag &
50+
fi
51+
52+
if [ "$settings" = "both" ]; then
53+
debug_flag=""
54+
if [ "$debug_mode" = true ]; then
55+
debug_flag="-d 7"
56+
fi
57+
h264grabber -r low -m "$model" -f &
58+
h264grabber -r high -m "$model" -f &
59+
rRTSPServer -r both -a "$enable_audio" -p 554 -u -w $debug_flag &
60+
fi
61+
62+
}
63+
64+
65+
# Read model name from file
66+
model=$(cat /home/app/.camver)
67+
version_cam=$(cat /home/yi-hack-v5/version)
68+
version_sd=$(cat /tmp/sd/yi-hack-v5/version)
69+
echo "Using model: $model"
70+
echo "Version on cam: $version_cam"
71+
echo "Version on sd: $version_sd"
72+
73+
read -p "Specify the operation (k for kill, l for launch): " operation
74+
75+
if [ "$operation" = "k" ] || [ "$operation" = "K" ]; then
76+
kill_all
77+
elif [ "$operation" = "l" ] || [ "$operation" = "L" ]; then
78+
read -p "Specify the settings (high, low, or both): " settings
79+
read -p "Enable audio? (y/n): " audio_choice
80+
81+
if [ "$audio_choice" = "y" ] || [ "$audio_choice" = "Y" ]; then
82+
execute_audio=true
83+
enable_audio="yes"
84+
else
85+
execute_audio=false
86+
enable_audio="no"
87+
fi
88+
89+
read -p "Execute in debug mode? (y/n): " debug_choice
90+
91+
if [ "$debug_choice" = "y" ] || [ "$debug_choice" = "Y" ]; then
92+
debug_mode=true
93+
else
94+
debug_mode=false
95+
fi
96+
97+
launch_apps
98+
else
99+
echo "Invalid operation."
100+
fi

src/static/static/home/yi-hack-v5/script/system.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,12 @@ if [[ $(get_config DISABLE_CLOUD) == "yes" ]] ; then
169169
sleep 2
170170
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
171171
sleep 4
172-
./mp4record &
173172
./cloud &
174-
#./p2p_tnp & <<< is this needed? It feels like those 5 seconds previews
175-
if [[ $(cat /home/app/.camver) != "yi_dome" ]] ; then
176-
./oss & #not sure what is oss
177-
fi
178-
#./watch_process & <<< this makes sure all other services that we removed are working so not needed
179173
)
180174
elif [[ $(get_config REC_WITHOUT_CLOUD) == "yes" ]] ; then
181175
(
182176
cd /home/app
183-
killall dispatch
184-
LD_PRELOAD=/home/yi-hack-v5/lib/ipc_multiplex.so ./dispatch &
185-
sleep 2
186-
LD_LIBRARY_PATH="/home/yi-hack-v5/lib:/lib:/home/lib:/home/app/locallib:/home/hisiko/hisilib" ./rmm &
187-
sleep 4
188177
./mp4record &
189-
./cloud &
190-
sleep 5
191-
killall -1 cloud
192178
)
193179
fi
194180

0 commit comments

Comments
 (0)