Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

vncsession-start.in 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. #
  3. # Copyright 2019 Pierre Ossman for Cendio AB
  4. #
  5. # This is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This software is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this software; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  18. # USA.
  19. #
  20. USERSFILE="@CMAKE_INSTALL_FULL_SYSCONFDIR@/tigervnc/vncserver.users"
  21. if [ $# -ne 1 ]; then
  22. echo "Syntax:" >&2
  23. echo " $0 <display>" >&2
  24. exit 1
  25. fi
  26. if [ ! -f "${USERSFILE}" ]; then
  27. echo "Users file ${USERSFILE} missing" >&2
  28. exit 1
  29. fi
  30. DISPLAY="$1"
  31. USER=`grep "^ *${DISPLAY}=" "${USERSFILE}" 2>/dev/null | head -1 | cut -d = -f 2- | sed 's/ *$//g'`
  32. if [ -z "${USER}" ]; then
  33. echo "No user configured for display ${DISPLAY}" >&2
  34. exit 1
  35. fi
  36. exec "@CMAKE_INSTALL_FULL_SBINDIR@/vncsession" "${USER}" "${DISPLAY}"