summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/x11vnc/OpenSLX/Distro/Debian.pm
blob: 6623d22ff32eaca813385ede66c6ace9e7ae5d41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright (c) 2008 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your suggestions, praise, or complaints to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
# x11vnc/OpenSLX/Distro/debian.pm
#    - provides Debian-specific overrides of the Distro API for the x11vnc 
#      plugin.
# -----------------------------------------------------------------------------
package x11vnc::OpenSLX::Distro::Debian;

use strict;
use warnings;

use base qw(x11vnc::OpenSLX::Distro::Base);

use OpenSLX::Basics;
use OpenSLX::Utils;

################################################################################
### interface methods
################################################################################

sub fillRunlevelScript
{
    my $self     = shift;

    my $script = unshiftHereDoc(<<"    End-of-Here");
        #!/bin/sh
        # Ubuntu/Debian specific start/stop script, generated via stage1 'x11vnc'
        # plugin install
        # inspiration taken from x11vnc start script:
        #   Copyright 1998-2007 x11vnc, Inc.  All rights reserved.
        #
        # This script manages the services needed to run x11vnc software
        
        # Basic support for the Linux Standard Base Specification 1.3
        ### BEGIN INIT INFO
        # Provides: x11vnc
        # Required-Start: \$syslog
        # Required-Stop:
        # Default-Start: 2 3 5
        # Default-Stop: 0 6
        # Short-Description: Manages the services needed to run x11vnc software
        # Description: Manages the services needed to run x11vnc software
        ### END INIT INFO
 
        # initialize the lsb status messages
        . /lib/lsb/init-functions

        [ -f /opt/openslx/plugin-repo/x11vnc/x11vnc-init ] \\
          && CMD="/opt/openslx/plugin-repo/x11vnc/x11vnc-init"

        case \$1 in
          start)
            log_daemon_msg "Starting x11vnc background services ..." "x11vnc"
            \$CMD start
            log_end_msg \$?
          ;;
          stop)
            log_daemon_msg "Stopping x11vnc background services ..." "x11vnc"
            \$CMD stop
            log_end_msg \$?
          ;;
          #status)
          #  log_daemon_msg "Say something useful here ..."
          #;;
          restart)
            \$0 stop
            \$0 start
            exit $?
          ;;
          *)
           log_success_msg "Usage: \$0 {start|stop|restart}"
            exit 2
          ;;
        esac
        exit 0
    End-of-Here
    return $script;
}

1;