#; kate: space-indent on; indent-width 2; syntax bash;

function Run_KillTeamViewer()
{
  local this="$0"			# ps: allow user names with more than 8 characters...
  local userlist="$(ps -e -o 'user:25,command' | grep TeamViewer | cut --delimiter=' ' -f 1 | sort -u)"

  if isSuperUser ; then		# if root, launch the script for all other users
    for user in $userlist ; do
      echo "kill '$this' - $user ($WINEPREFIX / $TV_PROFILE)"
      su -c "$this killImpl" - $user
    done
  else
    KillTeamViewerImpl       # kill for current user
  fi
}

function KillTeamViewerImpl()
{
    wineserver -k	# kill for current user
}

function Run_WineCfg()
{
  Init
  wine winecfg "$@"
}

function Run_RegEdit()
{
  Init
  wine regedit "$@"
}