Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
db892d5e
Commit
db892d5e
authored
Mar 10, 2021
by
longpanda
Browse files
optimization for script for UOS
parent
7166164a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
INSTALL/VentoyWebDeepin.sh
INSTALL/VentoyWebDeepin.sh
+7
-0
INSTALL/tool/WebUos.sh
INSTALL/tool/WebUos.sh
+23
-6
No files found.
INSTALL/VentoyWebDeepin.sh
View file @
db892d5e
#!/bin/sh
if
echo
"
$*
"
|
grep
-q
'[-]v'
;
then
set
-x
fi
print_usage
()
{
echo
'Usage: VentoyWebDeepin.sh [ OPTION ]'
echo
' OPTION: (optional)'
echo
' -H x.x.x.x http server IP address (default is 127.0.0.1)'
echo
' -p PORT http server PORT (default is 24680)'
echo
' -h print this help'
echo
' -v print verbose info'
echo
''
}
...
...
@@ -68,6 +73,8 @@ while [ -n "$1" ]; do
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
print_usage
exit
0
elif
[
"
$1
"
=
"-v"
]
;
then
VERBOSE
=
1
elif
[
"
$1
"
=
"-H"
]
;
then
shift
if
echo
$1
|
grep
-q
'[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'
;
then
...
...
INSTALL/tool/WebUos.sh
View file @
db892d5e
...
...
@@ -16,14 +16,29 @@ if [ -f ./tool/$TOOLDIR/V2DServer.xz ]; then
chmod
+x ./tool/
$TOOLDIR
/V2DServer
fi
rm
-rf
./
*
_VTMPDIR
vtWebTmpDir
=
$(
mktemp
-d
-p
./
--suffix
=
_VTMPDIR
)
V2DServer
"
$HOST
"
"
$PORT
"
&
V2DPid
=
$!
sleep
1
vtoy_trap_exit
()
{
[
-d
/proc/
$V2DPid
]
&&
kill
-2
$V2DPid
if
[
-n
"
$OLDDIR
"
]
;
then
CURDIR
=
$(
pwd
)
if
[
"
$CURDIR
"
!=
"
$OLDDIR
"
]
;
then
cd
"
$OLDDIR
"
fi
fi
exit
1
}
trap
vtoy_trap_exit HUP INT QUIT TSTP
sleep
1
vtVer
=
$(
cat
ventoy/version
)
echo
""
echo
"=================================================="
...
...
@@ -37,11 +52,13 @@ echo ""
echo
"########### Press Ctrl + C to exit ###############"
echo
""
uos-browser
--window-size
=
550,400
--app
=
"http://
${
HOST
}
:
${
PORT
}
/index.html?chrome-app"
--user-data-dir
=
$vtWebTmpDir
>>
$LOGFILE
2>&1
if
[
"
$VERBOSE
"
=
"1"
]
;
then
uos-browser
--window-size
=
550,400
--app
=
"http://
${
HOST
}
:
${
PORT
}
/index.html?chrome-app"
else
uos-browser
--window-size
=
550,400
--app
=
"http://
${
HOST
}
:
${
PORT
}
/index.html?chrome-app"
>
/dev/null 2>&1
fi
[
-d
/proc/
$V2DPid
]
&&
kill
-2
$V2DPid
[
-d
$vtWebTmpDir
]
&&
rm
-rf
$vtWebTmpDir
if
[
-n
"
$OLDDIR
"
]
;
then
CURDIR
=
$(
pwd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment