Skip to content

Commit 0a59482

Browse files
update _help() & start novnc
1 parent 77a8589 commit 0a59482

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

proot-env/udroid/udroid.sh

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,52 @@ function _backup() {
3737
- "/" -P |
3838
pv -s $(($(du -skx "/" | awk '{print $1}') * 1024)) |
3939
gzip --best >"$of".tar.gz
40-
4140
}
4241

4342
_help() {
4443
_msg_backup() {
45-
:
44+
msg "udroid backup [-o|--output <output file>]"
45+
msg "backup udroid to <output file>"
46+
msg
47+
msg "Options:"
48+
msg " -o|--output <output file> : output file name"
49+
msg
4650
}
4751
_msg_servic_exec() {
48-
:
52+
msg "udroid service_exec"
53+
msg
54+
msg "parses /usr/share/udroid/auto_start_service and starts services at startup"
4955
}
5056
_msg_startvnc() {
51-
:
57+
msg "udroid startvnc | startvnc"
58+
msg "starts vncserver at port 1 with name as UDROID"
59+
msg
60+
msg "Options:"
61+
msg " -h | --help to show this messege"
62+
msg " -p | --port to set the port to use"
63+
msg " --novnc to start novnc server!"
5264
}
5365
_msg_stopvnc() {
54-
:
66+
msg "udroid stopvnc | stopvnc"
67+
msg "stops vncserver and clears all pid files and sockets of port 1"
5568
}
69+
70+
case "$1" in
71+
backup)
72+
_msg_backup
73+
;;
74+
service_exec)
75+
_msg_servic_exec
76+
;;
77+
startvnc)
78+
_msg_startvnc
79+
;;
80+
stopvnc)
81+
_msg_stopvnc
82+
;;
83+
*)
84+
die "unknown word? $1" ;;
85+
esac
5686
}
5787

5888
function service_exec() {
@@ -64,6 +94,10 @@ function service_exec() {
6494
fi
6595
}
6696

97+
function no_vnc() {
98+
:
99+
}
100+
67101
function startvnc() {
68102
pubip=$(hostname -I)
69103
port='1'
@@ -79,7 +113,7 @@ function startvnc() {
79113
if ! $vnc; then
80114
vncserver -xstartup "${DEFAULT_XSTARTUP}" -localhost no -desktop "udroid Default VNC" :${port}
81115
else
82-
echo "A vncserver lock is found for port ${port}"
116+
msg "A vncserver lock is found for port ${port}"
83117
die "try using stopvnc"
84118
fi
85119

0 commit comments

Comments
 (0)