source: src-sh/de-logout/de-logout @ f9daf0c7

enter/10releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since f9daf0c7 was f9daf0c7, checked in by yurkis <yurkis@…>, 12 months ago

Added 'de-logout' script for correct desktop environment session exit. I will add functions to libpcbsd later. Kris, if you like it please add to build

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/sh
2
3get_logout_command()
4{
5    LOGOFF_COMM=`de-info | grep "Logout command:" | sed s/"Logout command: "//`
6   
7    if [ "$LOGOFF_COMM" == "" ] ; then
8      echo "Can not perform lof out for this desktop environment"
9    exit 1
10    fi
11}
12
13do_logout()
14{
15    get_logout_command
16    if [ "$LOGOFF_COMM" == "" ] ; then
17        echo "Can not perform logout out for this desktop environment"
18        exit 1
19    fi
20    echo "Performing logout..."
21    `$LOGOFF_COMM`
22    exit 0
23}
24
25do_check()
26{
27    get_logout_command
28    if [ "$LOGOFF_COMM" == "" ] ; then
29        echo "Logout is not possible"
30        exit 1
31    fi
32    echo "Logout is possible"
33    exit 0
34}
35
36display_help()
37{
38    echo "de-logout - current desktop environment session exit"
39    echo "Usage:"
40    echo "      de-logout [-check] [-help]"
41    echo "           -check - check logout posability"
42    echo "           -help - display this text"
43    echo "           (without any commands) - performs desktop environment session exit"
44}
45
46if [ "$1" = "-help" ] || [ "$1" = "--help" ] || [ "$1" = "-?" ] 
47then
48  display_help
49  exit 0
50fi
51
52if [ "$1" = "-check" ]
53then
54  do_check
55fi
56
57do_logout
Note: See TracBrowser for help on using the repository browser.