commit d3060b46b357c399d522e8346dd6c9b99c322343 Author: hasufell Date: Sat Sep 21 20:08:07 2013 +0200 remove all daemon/systemd related bits diff --git a/script/tvw_main b/script/tvw_main index bdff58b..1058d47 100644 --- a/script/tvw_main +++ b/script/tvw_main @@ -2,7 +2,6 @@ source "$TV_SCRIPT_DIR/tvw_config" source "$TV_SCRIPT_DIR/tvw_aux" -source "$TV_SCRIPT_DIR/tvw_daemon" source "$TV_SCRIPT_DIR/tvw_profile" @@ -17,7 +16,6 @@ function Main() --help ) PrintHelp ;; --version ) PrintVersion ;; --info ) PrintInfo ;; - --daemon ) Run_Daemon $opt ;; --winecfg ) shift; Run_WineCfg "$@" ;; --regedit ) shift; Run_RegEdit "$@" ;; --kill ) Run_KillTeamViewer ;; @@ -174,26 +172,14 @@ function Run_RegEdit() wine regedit "$@" } -function Run_Daemon() -{ - local opt="$1" - - case "$opt" in - ( disable ) removeDaemon || rootSuggest ;; - ( enable ) installDaemon || rootSuggest ;; - ( start | stop | restart ) cmdDaemon $opt || rootSuggest ;; - ( status ) cmdDaemon $opt ;; - ( * ) echo "unknown option '$opt'" ;; - esac -} - function SetPasswd() { + echo "Stop your teamviewer daemon first, then press enter." + read + local pwd="$1" [ -n "$pwd" ] || die 'no password specified' - Run_Daemon 'stop' > /dev/null - $TV_BIN_DIR/teamviewerd --passwd "$pwd" case $? in 0 ) echo 'ok' ;; @@ -203,19 +189,19 @@ function SetPasswd() * ) echo 'unknown response' ;; esac - Run_Daemon 'start' || die 'failed to restart the daemon' - echo + echo "You may start your teamviewer daemon again." } function ExportLicense() { + echo "Stop your teamviewer daemon first, then press enter." + read + local license="$1" local path='/tmp/tv_global.conf' [ -n "$license" ] || die 'no license specified' - Run_Daemon 'stop' > /dev/null - $TV_BIN_DIR/teamviewerd --export-license "$license" "$path" case $? in 0 ) echo "ok - license exported to '$path'" ;; @@ -223,8 +209,7 @@ function ExportLicense() * ) echo 'unknown response' ;; esac - Run_Daemon 'start' || die 'failed to restart the daemon' - echo + echo "You may start your teamviewer daemon again." } function CreateZipLog() @@ -265,20 +250,12 @@ function PrintHelp() ABecho "teamviewer --passwd [PASSWD]" "set a password (useful when installing remote (ssh)" ABecho "teamviewer --ziplog" "create a zip containing all teamviewer logs (useful when contacting support)" echo - ABecho "teamviewer --daemon status" "show current status of the TeamViewer daemon" - ABecho "teamviewer --daemon start" "start TeamViewer daemon" - ABecho "teamviewer --daemon stop" "stop TeamViewer daemon" - ABecho "teamviewer --daemon restart" "stop/start TeamViewer daemon" - ABecho "teamviewer --daemon disable" "disable TeamViewer daemon - don't start daemon on system startup" - ABecho "teamviewer --daemon enable" "enable TeamViewer daemon - start daemon on system startup (default)" } function PrintInfo() { PrintVersion echo - PrintDaemonStatus - echo PrintTeamViewerID } @@ -287,15 +264,6 @@ function PrintVersion() ABecho "TeamViewer" "$TV_VERSION" } -function PrintDaemonStatus() -{ - local cmd="$(daemonCtl 'status')" - local txt="$(eval "$cmd")" - [ $? = 0 ] || txt='n/a (error)' - - ABecho "teamviewerd status" "$txt" -} - function PrintTeamViewerID() { local config="$TV_BASE_DIR/config/global.conf" @@ -307,6 +275,6 @@ function PrintTeamViewerID() ABecho "TeamViewer ID:" "$tvid" else echo "TeamViewer ID: not found" - echo "Try restarting the TeamViewer daemon (e.g. teamviewer --daemon restart)" + echo "Try restarting the TeamViewer daemon." fi }