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
|
37 |
PrintDaemonStatus |
30 |
PrintDaemonStatus |
38 |
echo |
31 |
echo |
39 |
PrintTeamViewerID |
32 |
PrintTeamViewerID |
40 |
} |
|
|
41 |
|
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 |
} |
33 |
} |
54 |
|
34 |
|
55 |
function PrintTeamViewerID() |
35 |
function PrintTeamViewerID() |
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 |
|
58 |
|
76 |
installedTVorDie |
59 |
installedTVorDie |
77 |
isSuperUser || die 'You need root permissions for this operation' |
60 |
isSuperUser || die 'You need root permissions for this operation' |
78 |
|
61 |
|
79 |
Run_Daemon 'stop' > /dev/null |
|
|
80 |
|
81 |
"$TV_BIN_DIR/teamviewerd" --passwd "$pwd" |
62 |
"$TV_BIN_DIR/teamviewerd" --passwd "$pwd" |
82 |
case $? in |
63 |
case $? in |
83 |
0 ) echo 'ok' ;; |
64 |
0 ) echo 'ok' ;; |
Link Here
|
88 |
* ) echo 'unknown response' ;; |
69 |
* ) echo 'unknown response' ;; |
89 |
esac |
70 |
esac |
90 |
|
71 |
|
91 |
Run_Daemon 'start' > /dev/null || die 'failed to restart the daemon' |
72 |
echo "You may start your teamviewer daemon again." |
92 |
echo |
|
|
93 |
} |
73 |
} |
94 |
|
74 |
|
95 |
function ExportLicense() |
75 |
function ExportLicense() |
96 |
{ |
76 |
{ |
|
|
77 |
echo "Stop your teamviewer daemon first, then press enter." |
78 |
read |
79 |
|
97 |
local license="$1" |
80 |
local license="$1" |
98 |
local path='/tmp/tv_global.conf' |
81 |
local path='/tmp/tv_global.conf' |
99 |
|
82 |
|
Link Here
|
101 |
|
84 |
|
102 |
isSuperUser || die 'You need root permissions for this operation' |
85 |
isSuperUser || die 'You need root permissions for this operation' |
103 |
|
86 |
|
104 |
Run_Daemon 'stop' > /dev/null |
|
|
105 |
|
106 |
"$TV_BIN_DIR/teamviewerd" --export-license "$license" "$path" |
87 |
"$TV_BIN_DIR/teamviewerd" --export-license "$license" "$path" |
107 |
case $? in |
88 |
case $? in |
108 |
0 ) echo "ok - license exported to '$path'" ;; |
89 |
0 ) echo "ok - license exported to '$path'" ;; |
Link Here
|
110 |
* ) echo 'unknown response' ;; |
91 |
* ) echo 'unknown response' ;; |
111 |
esac |
92 |
esac |
112 |
|
93 |
|
113 |
Run_Daemon 'start' > /dev/null || die 'failed to restart the daemon' |
94 |
echo "You may start your teamviewer daemon again." |
114 |
echo |
|
|
115 |
} |
95 |
} |
116 |
|
96 |
|
117 |
function StripPersonalInformation() |
97 |
function StripPersonalInformation() |