File: nodm.config

package info (click to toggle)
nodm 0.13-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 548 kB
  • sloc: ansic: 1,942; sh: 368; makefile: 84
file content (126 lines) | stat: -rw-r--r-- 3,286 bytes parent folder | download | duplicates (3)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/sh

# Partially based on gdm3.config, © 2000-2001 Branden Robinson.
# Licensed under the GNU General Public License, version 2.  See the file
# /usr/share/common-licenses/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.


set -e

. /usr/share/debconf/confmodule

THIS_PACKAGE=nodm
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager

# set default display manager

db_get shared/default-x-display-manager
OLD_DEFAULT="$RET"

db_metaget shared/default-x-display-manager owners
OWNERS="$RET"
db_metaget shared/default-x-display-manager choices
CHOICES="$RET"

if [ "$OWNERS" != "$CHOICES" ]; then
  db_subst shared/default-x-display-manager choices $OWNERS
  db_fset shared/default-x-display-manager seen false
fi

db_input high shared/default-x-display-manager || true
db_go

# using this display manager?
db_get shared/default-x-display-manager
CURRENT_DEFAULT="$RET"
# set a flag to indicate to postinst that we need to update from debconf
if [ "$OLD_DEFAULT" != "$CURRENT_DEFAULT" ]; then
  DEFAULT_DISPLAY_MANAGER_DIR=$(dirname $DEFAULT_DISPLAY_MANAGER_FILE)
  test -e $DEFAULT_DISPLAY_MANAGER_DIR || mkdir -p $DEFAULT_DISPLAY_MANAGER_DIR
  touch $DEFAULT_DISPLAY_MANAGER_FILE.debconf-update
fi

if [ -s /etc/default/nodm ] ; then
	. /etc/default/nodm

	if [ -n "$NODM_ENABLED" ] ; then
		db_set nodm/enabled "$NODM_ENABLED"
	fi
	if [ -n "$NODM_USER" ] ; then
		db_set nodm/user "$NODM_USER"
	fi

	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.10"
	then
		# After 0.10 nodm/xinit is not needed anymore
		# don't fail if it was unregistered before
		db_unregister nodm/xinit || true
	fi

	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.5"
	then
		# If I'm coming from <0.5, remove vtN from NODM_X_OPTIONS and
		# set first_vt to N
		if [ -n "$NODM_X_OPTIONS" ] ; then
			# Try to extract vtN from NODM_X_OPTIONS
			VTNUM=`echo "$NODM_X_OPTIONS" | sed -re 's/^.*\<vt([0-9]+)\>.*$/\1/'`
			if [ "$VTNUM" = "$NODM_X_OPTIONS" ]
			then
				VTNUM=
			else
				# If it found vtN, strip it away from NODM_X_OPTIONS
				NODM_X_OPTIONS=`echo "$NODM_X_OPTIONS" | sed -r -e 's/[[:blank:]]*\<vt([0-9]+)\>[[:blank:]]/ /' -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//'`
			fi
			db_set nodm/x_options "$NODM_X_OPTIONS"
		fi
		if [ -n "$NODM_FIRST_VT" ] ; then
			db_set nodm/first_vt "$NODM_FIRST_VT"
		elif [ -n "$VTNUM" ]; then
			# If VTNUM was not set but we found it in NODM_X_OPTIONS, set it here
			db_set nodm/first_vt "$VTNUM"
		fi
	else
		if [ -n "$NODM_FIRST_VT" ] ; then
			db_set nodm/first_vt "$NODM_FIRST_VT"
		fi
		if [ -n "$NODM_X_OPTIONS" ] ; then
			db_set nodm/x_options "$NODM_X_OPTIONS"
		fi
	fi
	if [ -n "$NODM_MIN_SESSION_TIME" ]; then
		db_set nodm/min_session_time "$NODM_MIN_SESSION_TIME"
	fi
	if [ -n "$NODM_XSESSION" ]; then
		db_set nodm/xsession "$NODM_XSESSION"
	fi
	if [ -n "$NODM_X_TIMEOUT" ]; then
		db_set nodm/x_timeout "$NODM_X_TIMEOUT"
	fi
fi

db_input high nodm/enabled || true
db_go

db_get nodm/enabled
START="$RET"

if [ "x$START" = "xtrue" ] ; then
	db_input medium nodm/user || true
	db_go

	db_input low nodm/first_vt || true
	db_go

	db_input low nodm/x_options || true
	db_go

	db_input low nodm/min_session_time || true
	db_go

	db_input low nodm/xsession || true
	db_go

	db_input low nodm/x_timeout || true
	db_go
fi