|
Link Here
|
| 16 |
isInstalledTV || return |
16 |
isInstalledTV || return |
| 17 |
ABecho "teamviewer --passwd [PASSWD]" "set a password (useful when installing remote (ssh)" |
17 |
ABecho "teamviewer --passwd [PASSWD]" "set a password (useful when installing remote (ssh)" |
| 18 |
echo |
18 |
echo |
| 19 |
ABecho "teamviewer --daemon status" "show current status of the TeamViewer daemon" |
|
|
| 20 |
ABecho "teamviewer --daemon start" "start TeamViewer daemon" |
| 21 |
ABecho "teamviewer --daemon stop" "stop TeamViewer daemon" |
| 22 |
ABecho "teamviewer --daemon restart" "stop/start TeamViewer daemon" |
| 23 |
ABecho "teamviewer --daemon disable" "disable TeamViewer daemon - don't start daemon on system startup" |
| 24 |
ABecho "teamviewer --daemon enable" "enable TeamViewer daemon - start daemon on system startup (default)" |
| 25 |
echo |
| 26 |
} |
19 |
} |
| 27 |
|
20 |
|
| 28 |
function PrintVersion() |
21 |
function PrintVersion() |
|
Link Here
|
| 39 |
PrintTeamViewerID |
32 |
PrintTeamViewerID |
| 40 |
} |
33 |
} |
| 41 |
|
34 |
|
| 42 |
function PrintDaemonStatus() |
|
|
| 43 |
{ |
| 44 |
local cmd="$(daemonCtl 'status')" |
| 45 |
local txt="n/a" |
| 46 |
|
| 47 |
if [ isInstalledTV ] ; then |
| 48 |
txt="$(eval "$cmd")" |
| 49 |
[ $? = 0 ] || txt='n/a (error)' |
| 50 |
fi |
| 51 |
|
| 52 |
ABecho "teamviewerd status" "$txt" |
| 53 |
} |
| 54 |
|
| 55 |
function PrintTeamViewerID() |
35 |
function PrintTeamViewerID() |
| 56 |
{ |
36 |
{ |
| 57 |
local config="$TV_BASE_DIR/config/global.conf" |
37 |
local config="$TV_BASE_DIR/config/global.conf" |
|
Link Here
|
| 64 |
ABecho "TeamViewer ID:" "$tvid" |
44 |
ABecho "TeamViewer ID:" "$tvid" |
| 65 |
|
45 |
|
| 66 |
if [ -z "$tvid" ] && isInstalledTV; then |
46 |
if [ -z "$tvid" ] && isInstalledTV; then |
| 67 |
echo "Try restarting the TeamViewer daemon (e.g. teamviewer --daemon restart)" |
47 |
echo "Try restarting the TeamViewer daemon." |
| 68 |
fi |
48 |
fi |
| 69 |
} |
49 |
} |
| 70 |
|
50 |
|
| 71 |
function SetPasswd() |
51 |
function SetPasswd() |
| 72 |
{ |
52 |
{ |
|
|
53 |
echo "Stop your teamviewer daemon first, then press enter." |
| 54 |
read |
| 55 |
|
| 73 |
local pwd="$1" |
56 |
local pwd="$1" |
| 74 |
[ -n "$pwd" ] || die 'no password specified' |
57 |
[ -n "$pwd" ] || die 'no password specified' |
| 75 |
|
|
|
| 76 |
Run_Daemon 'stop' > /dev/null |
| 77 |
|
58 |
|
| 78 |
$TV_BIN_DIR/teamviewerd --passwd "$pwd" |
59 |
$TV_BIN_DIR/teamviewerd --passwd "$pwd" |
| 79 |
case $? in |
60 |
case $? in |
|
Link Here
|
| 84 |
* ) echo 'unknown response' ;; |
65 |
* ) echo 'unknown response' ;; |
| 85 |
esac |
66 |
esac |
| 86 |
|
67 |
|
| 87 |
Run_Daemon 'start' || die 'failed to restart the daemon' |
68 |
echo "You may start your teamviewer daemon again." |
| 88 |
echo |
|
|
| 89 |
} |
69 |
} |
| 90 |
|
70 |
|
| 91 |
function ExportLicense() |
71 |
function ExportLicense() |
| 92 |
{ |
72 |
{ |
|
|
73 |
echo "Stop your teamviewer daemon first, then press enter." |
| 74 |
read |
| 75 |
|
| 93 |
local license="$1" |
76 |
local license="$1" |
| 94 |
local path='/tmp/tv_global.conf' |
77 |
local path='/tmp/tv_global.conf' |
| 95 |
|
78 |
|
| 96 |
[ -n "$license" ] || die 'no license specified' |
79 |
[ -n "$license" ] || die 'no license specified' |
| 97 |
|
80 |
|
| 98 |
Run_Daemon 'stop' > /dev/null |
|
|
| 99 |
|
| 100 |
$TV_BIN_DIR/teamviewerd --export-license "$license" "$path" |
81 |
$TV_BIN_DIR/teamviewerd --export-license "$license" "$path" |
| 101 |
case $? in |
82 |
case $? in |
| 102 |
0 ) echo "ok - license exported to '$path'" ;; |
83 |
0 ) echo "ok - license exported to '$path'" ;; |
|
Link Here
|
| 104 |
* ) echo 'unknown response' ;; |
85 |
* ) echo 'unknown response' ;; |
| 105 |
esac |
86 |
esac |
| 106 |
|
87 |
|
| 107 |
Run_Daemon 'start' || die 'failed to restart the daemon' |
88 |
echo "You may start your teamviewer daemon again." |
| 108 |
echo |
|
|
| 109 |
} |
89 |
} |
| 110 |
|
90 |
|
| 111 |
function StripPersonalInformation() |
91 |
function StripPersonalInformation() |