|
Link Here
|
| 31 |
{ |
31 |
{ |
| 32 |
PrintVersion |
32 |
PrintVersion |
| 33 |
echo |
33 |
echo |
| 34 |
PrintDaemonStatus |
|
|
| 35 |
echo |
| 36 |
PrintTeamViewerID |
34 |
PrintTeamViewerID |
| 37 |
} |
35 |
} |
| 38 |
|
36 |
|
| 39 |
function PrintDaemonStatus() |
|
|
| 40 |
{ |
| 41 |
local cmd="$(daemonCtl 'status')" |
| 42 |
local txt="$(eval "$cmd")" |
| 43 |
[ $? = 0 ] || txt='n/a (error)' |
| 44 |
|
| 45 |
ABecho "teamviewerd status" "$txt" |
| 46 |
} |
| 47 |
|
| 48 |
function PrintTeamViewerID() |
37 |
function PrintTeamViewerID() |
| 49 |
{ |
38 |
{ |
| 50 |
local config="$TV_BASE_DIR/config/global.conf" |
39 |
local config="$TV_BASE_DIR/config/global.conf" |
|
Link Here
|
| 55 |
if [ -n "$tvid" ]; then |
44 |
if [ -n "$tvid" ]; then |
| 56 |
ABecho "TeamViewer ID:" "$tvid" |
45 |
ABecho "TeamViewer ID:" "$tvid" |
| 57 |
else |
46 |
else |
| 58 |
echo "TeamViewer ID: not found" |
47 |
echo "Try restarting the TeamViewer daemon." |
| 59 |
echo "Try restarting the TeamViewer daemon (e.g. teamviewer --daemon restart)" |
|
|
| 60 |
fi |
48 |
fi |
| 61 |
} |
49 |
} |
| 62 |
|
50 |
|
| 63 |
function SetPasswd() |
51 |
function SetPasswd() |
| 64 |
{ |
52 |
{ |
|
|
53 |
echo "Stop your teamviewer daemon first, then press enter." |
| 54 |
read |
| 55 |
|
| 65 |
local pwd="$1" |
56 |
local pwd="$1" |
| 66 |
[ -n "$pwd" ] || die 'no password specified' |
57 |
[ -n "$pwd" ] || die 'no password specified' |
| 67 |
|
58 |
|
| 68 |
Run_Daemon 'stop' > /dev/null |
|
|
| 69 |
|
| 70 |
$TV_BIN_DIR/teamviewerd --passwd "$pwd" |
59 |
$TV_BIN_DIR/teamviewerd --passwd "$pwd" |
| 71 |
case $? in |
60 |
case $? in |
| 72 |
0 ) echo 'ok' ;; |
61 |
0 ) echo 'ok' ;; |
|
Link Here
|
| 76 |
* ) echo 'unknown response' ;; |
65 |
* ) echo 'unknown response' ;; |
| 77 |
esac |
66 |
esac |
| 78 |
|
67 |
|
| 79 |
Run_Daemon 'start' || die 'failed to restart the daemon' |
68 |
echo "You may start your teamviewer daemon again." |
| 80 |
echo |
|
|
| 81 |
} |
69 |
} |
| 82 |
|
70 |
|
| 83 |
function ExportLicense() |
71 |
function ExportLicense() |
| 84 |
{ |
72 |
{ |
|
|
73 |
echo "Stop your teamviewer daemon first, then press enter." |
| 74 |
read |
| 75 |
|
| 85 |
local license="$1" |
76 |
local license="$1" |
| 86 |
local path='/tmp/tv_global.conf' |
77 |
local path='/tmp/tv_global.conf' |
| 87 |
|
78 |
|
| 88 |
[ -n "$license" ] || die 'no license specified' |
79 |
[ -n "$license" ] || die 'no license specified' |
| 89 |
|
|
|
| 90 |
Run_Daemon 'stop' > /dev/null |
| 91 |
|
80 |
|
| 92 |
$TV_BIN_DIR/teamviewerd --export-license "$license" "$path" |
81 |
$TV_BIN_DIR/teamviewerd --export-license "$license" "$path" |
| 93 |
case $? in |
82 |
case $? in |
|
Link Here
|
| 96 |
* ) echo 'unknown response' ;; |
85 |
* ) echo 'unknown response' ;; |
| 97 |
esac |
86 |
esac |
| 98 |
|
87 |
|
| 99 |
Run_Daemon 'start' || die 'failed to restart the daemon' |
88 |
echo "You may start your teamviewer daemon again." |
| 100 |
echo |
|
|
| 101 |
} |
89 |
} |
| 102 |
|
90 |
|
| 103 |
function CreateZipLog() |
91 |
function CreateZipLog() |