1 |
idl0r 11/12/31 18:33:40 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: webmin-1.570-r1.ebuild webmin-1.560-r1.ebuild |
5 |
Removed: webmin-1.570.ebuild webmin-1.560.ebuild |
6 |
Log: |
7 |
Revbump. Don't use deprecated start-stop-daemon options, bug 377843 and bug 381895. |
8 |
|
9 |
(Portage version: 2.1.10.41/cvs/Linux i686) |
10 |
|
11 |
Revision Changes Path |
12 |
1.193 app-admin/webmin/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/ChangeLog?rev=1.193&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/ChangeLog?rev=1.193&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/ChangeLog?r1=1.192&r2=1.193 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/app-admin/webmin/ChangeLog,v |
21 |
retrieving revision 1.192 |
22 |
retrieving revision 1.193 |
23 |
diff -u -r1.192 -r1.193 |
24 |
--- ChangeLog 12 Oct 2011 21:10:27 -0000 1.192 |
25 |
+++ ChangeLog 31 Dec 2011 18:33:39 -0000 1.193 |
26 |
@@ -1,6 +1,15 @@ |
27 |
# ChangeLog for app-admin/webmin |
28 |
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/ChangeLog,v 1.192 2011/10/12 21:10:27 hwoarang Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/ChangeLog,v 1.193 2011/12/31 18:33:39 idl0r Exp $ |
31 |
+ |
32 |
+*webmin-1.570-r1 (31 Dec 2011) |
33 |
+*webmin-1.560-r1 (31 Dec 2011) |
34 |
+ |
35 |
+ 31 Dec 2011; Christian Ruppert <idl0r@g.o> -webmin-1.560.ebuild, |
36 |
+ +webmin-1.560-r1.ebuild, -webmin-1.570.ebuild, +webmin-1.570-r1.ebuild, |
37 |
+ files/init.d.webmin: |
38 |
+ Revbump. Don't use deprecated start-stop-daemon options, bug 377843 and bug |
39 |
+ 381895. |
40 |
|
41 |
*webmin-1.570 (12 Oct 2011) |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
1.1 app-admin/webmin/webmin-1.570-r1.ebuild |
47 |
|
48 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/webmin-1.570-r1.ebuild?rev=1.1&view=markup |
49 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/webmin-1.570-r1.ebuild?rev=1.1&content-type=text/plain |
50 |
|
51 |
Index: webmin-1.570-r1.ebuild |
52 |
=================================================================== |
53 |
# Copyright 1999-2011 Gentoo Foundation |
54 |
# Distributed under the terms of the GNU General Public License v2 |
55 |
# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/webmin-1.570-r1.ebuild,v 1.1 2011/12/31 18:33:39 idl0r Exp $ |
56 |
|
57 |
EAPI="3" |
58 |
|
59 |
inherit eutils pam ssl-cert |
60 |
|
61 |
DESCRIPTION="A web-based Unix systems administration interface" |
62 |
HOMEPAGE="http://www.webmin.com/" |
63 |
SRC_URI="minimal? ( mirror://sourceforge/webadmin/${P}-minimal.tar.gz ) |
64 |
!minimal? ( mirror://sourceforge/webadmin/${P}.tar.gz )" |
65 |
|
66 |
LICENSE="BSD" |
67 |
SLOT="0" |
68 |
|
69 |
KEYWORDS="~amd64 ~x86" |
70 |
|
71 |
# NOTE: The ssl flag auto added by ssl-cert eclass is not used actually |
72 |
# because openssl is forced by dev-perl/Net-SSLeay |
73 |
IUSE="minimal +ssl mysql postgres ldap" |
74 |
|
75 |
# All the required perl modules can be found easily using (in Webmin's root src dir): |
76 |
# find . -name cpan_modules.pl -exec grep "::" {} \; |
77 |
# NOTE: If Webmin doesn't find the required perl modules, it offers(runtime) the user |
78 |
# to install them using the in-built cpan module, and this will mess up perl on the system |
79 |
# That's why some modules are forced without a use flag |
80 |
# NOTE: pam and ssl deps are forced for security and Gentoo compliance installation reasons |
81 |
DEPEND="virtual/perl-Sys-Syslog |
82 |
virtual/perl-Time-HiRes |
83 |
virtual/perl-Time-Local |
84 |
dev-perl/Authen-Libwrap |
85 |
dev-perl/IO-Tty |
86 |
dev-perl/MD5 |
87 |
dev-perl/Net-SSLeay |
88 |
dev-perl/Authen-PAM |
89 |
dev-perl/Sys-Hostname-Long |
90 |
!minimal? ( |
91 |
mysql? ( dev-perl/DBD-mysql ) |
92 |
postgres? ( dev-perl/DBD-Pg ) |
93 |
ldap? ( dev-perl/perl-ldap ) |
94 |
dev-perl/XML-Generator |
95 |
dev-perl/XML-Parser |
96 |
)" |
97 |
RDEPEND="${DEPEND}" |
98 |
|
99 |
src_prepare() { |
100 |
local perl="$( which perl )" |
101 |
|
102 |
# Remove the unnecessary and incompatible files |
103 |
rm -rf acl/Authen-SolarisRBAC-0.1* |
104 |
if ! use minimal ; then |
105 |
rm -rf {format,{bsd,hpux,sgi}exports,zones,rbac} |
106 |
rm -f mount/{free,net,open}bsd-mounts* |
107 |
rm -f mount/macos-mounts* |
108 |
fi |
109 |
|
110 |
# For security reasons remove the SSL certificate that comes with Webmin |
111 |
# We will create our own later |
112 |
rm -f miniserv.pem |
113 |
|
114 |
# Remove the Webmin setup scripts to avoid Webmin in runtime to mess up config |
115 |
# We will use our own later |
116 |
rm -f setup.{sh,pl} |
117 |
|
118 |
# Fix the permissions of the install files |
119 |
chmod -R og-w "${S}" |
120 |
|
121 |
# Since we should not modify any files after install |
122 |
# we set the perl path in all cgi and pl files here using Webmin's routines |
123 |
# The pl file is Prefix safe and works only on provided input, no other filesystem files |
124 |
ebegin "Fixing perl path in source files" |
125 |
(find "${S}" -name '*.cgi' -print ; find "${S}" -name '*.pl' -print) | $perl "${S}"/perlpath.pl $perl - |
126 |
eend $? |
127 |
} |
128 |
|
129 |
src_install() { |
130 |
# Create config dir and keep |
131 |
diropts -m0755 |
132 |
dodir /etc/webmin |
133 |
keepdir /etc/webmin |
134 |
|
135 |
# Create install dir |
136 |
# Third party modules installed through Webmin go here too, so keep |
137 |
dodir /usr/libexec/webmin |
138 |
keepdir /usr/libexec/webmin |
139 |
|
140 |
# Copy our own setup script to installation folder |
141 |
insinto /usr/libexec/webmin |
142 |
newins "${FILESDIR}"/gentoo-setup gentoo-setup.sh |
143 |
fperms 0744 /usr/libexec/webmin/gentoo-setup.sh |
144 |
|
145 |
# This is here if we ever want in future ebuilds to add some specific |
146 |
# config values in the /etc/webmin/miniserv.conf |
147 |
# The format of this file should be the same as the one of miniserv.conf: |
148 |
# var=value |
149 |
# |
150 |
# Uncomment it if you use such file. Before that check if upstream |
151 |
# has this file in root dir too. |
152 |
#newins "${FILESDIR}/miniserv-conf" miniserv-conf |
153 |
|
154 |
# Create the log dir and keep |
155 |
diropts -m0700 |
156 |
dodir /var/log/webmin |
157 |
keepdir /var/log/webmin |
158 |
|
159 |
# Create the init.d file and put the neccessary variables there |
160 |
newinitd "${FILESDIR}"/init.d.webmin webmin |
161 |
sed -i \ |
162 |
-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \ |
163 |
-e "s:%pid%:${EROOT}var/run/webmin.pid:" \ |
164 |
-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \ |
165 |
-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \ |
166 |
"${ED}etc/init.d/webmin" \ |
167 |
|| die "Failed to patch the webmin init file" |
168 |
|
169 |
# Setup pam |
170 |
pamd_mimic system-auth webmin auth account session |
171 |
|
172 |
# Copy files to installation folder |
173 |
ebegin "Copying install files to destination" |
174 |
cp -pPR "${S}"/* "${ED}usr/libexec/webmin" |
175 |
eend $? |
176 |
} |
177 |
|
178 |
pkg_preinst() { |
179 |
# First stop service if running so Webmin to not messup our config |
180 |
ebegin "Stopping any running Webmin instance prior merging" |
181 |
rc-service --ifexists -- webmin --ifstarted stop |
182 |
eend $? |
183 |
} |
184 |
|
185 |
pkg_postinst() { |
186 |
# Run pkg_config phase first - non interactively |
187 |
export INTERACTIVE="no" |
188 |
pkg_config |
189 |
# Every next time pkg_config should be interactive |
190 |
INTERACTIVE="yes" |
191 |
|
192 |
ewarn |
193 |
ewarn "Bare in mind that not all Webmin modules are Gentoo tweaked and may have some issues." |
194 |
ewarn "Always be careful when using modules that modify init entries, do update of webmin, install CPAN modules etc." |
195 |
ewarn "To avoid problems, please before using any module, look at its configuration options first." |
196 |
ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)" |
197 |
ewarn |
198 |
elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'" |
199 |
elog "- The default URL to connect to Webmin is: https://localhost:10000" |
200 |
elog "- The default user that can login is: root" |
201 |
elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'" |
202 |
} |
203 |
|
204 |
pkg_prerm() { |
205 |
# First stop service if running - we do not want Webmin to mess up config |
206 |
ebegin "Stopping any running Webmin instance prior unmerging" |
207 |
rc-service --ifexists -- webmin --ifstarted stop |
208 |
eend $? |
209 |
} |
210 |
|
211 |
pkg_postrm() { |
212 |
ewarn |
213 |
ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled" |
214 |
ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing." |
215 |
ewarn "To fix this just disable them if you intend to use Webmin again," |
216 |
ewarn "OR delete them if not." |
217 |
ewarn |
218 |
} |
219 |
|
220 |
pkg_config(){ |
221 |
# First stop service if running |
222 |
ebegin "Stopping any running Webmin instance" |
223 |
rc-service --ifexists -- webmin --ifstarted stop |
224 |
eend $? |
225 |
|
226 |
# Next set the default reset variable to 'none' |
227 |
# reset/_reset can be: |
228 |
# 'none' - does not reset anything, just upgrades if a conf is present |
229 |
# OR installs new conf if a conf is missing |
230 |
# 'soft' - deletes only $config_dir/config file and thus resetting most |
231 |
# conf values to their defaults. Keeps the specific Webmin cron jobs |
232 |
# 'hard' - deletes all files in $config_dir (keeping the .keep_* Gentoo file) |
233 |
# and thus resetting all Webmin. Deletes the specific Webmin cron jobs too. |
234 |
local _reset="none" |
235 |
|
236 |
# If in interactive mode ask user what should we do |
237 |
if [[ "${INTERACTIVE}" = "yes" ]]; then |
238 |
einfo |
239 |
einfo "Please enter the number of the action you would like to perform?" |
240 |
einfo |
241 |
einfo "1. Update configuration" |
242 |
einfo " (keeps old config options and adds the new ones)" |
243 |
einfo "2. Soft reset configuration" |
244 |
einfo " (keeps some old config options, the other options are set to default)" |
245 |
ewarn " All Webmin users will be reset" |
246 |
einfo "3. Hard reset configuration" |
247 |
einfo " (all options including module options are set to default)" |
248 |
ewarn " You will lose all Webmin configuration options you have done till now" |
249 |
einfo "4. Exit this configuration utility (default)" |
250 |
while [ "$correct" != "true" ] ; do |
251 |
read answer |
252 |
if [[ "$answer" = "1" ]] ; then |
253 |
_reset="none" |
254 |
correct="true" |
255 |
elif [[ "$answer" = "2" ]] ; then |
256 |
_reset="soft" |
257 |
correct="true" |
258 |
elif [[ "$answer" = "3" ]] ; then |
259 |
_reset="hard" |
260 |
correct="true" |
261 |
elif [ "$answer" = "4" -o "$answer" = "" ] ; then |
262 |
die "User aborted configuration." |
263 |
else |
264 |
echo "Answer not recognized. Enter a number from 1 to 4" |
265 |
fi |
266 |
done |
267 |
|
268 |
if [[ "$_reset" = "hard" ]]; then |
269 |
while [ "$sure" != "true" ] ; do |
270 |
ewarn "You will lose all Webmin configuration options you have done till now." |
271 |
ewarn "Are you sure you want to do this? (y/n)" |
272 |
read answer |
273 |
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
274 |
sure="true" |
275 |
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
276 |
die "User aborted configuration." |
277 |
else |
278 |
echo "Answer not recognized. Enter 'y' or 'n'" |
279 |
fi |
280 |
done |
281 |
fi |
282 |
fi |
283 |
|
284 |
export reset=$_reset |
285 |
|
286 |
# Create ssl certificate for Webmin if there is not one in the proper place |
287 |
if [[ ! -e "${EROOT}etc/ssl/webmin/server.pem" ]]; then |
288 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Webmin Server}" |
289 |
SSL_COMMONNAME="${SSL_COMMONNAME:-*}" |
290 |
install_cert "${EROOT}/etc/ssl/webmin/server" |
291 |
fi |
292 |
|
293 |
# Ensure all paths passed to the setup script use EROOT |
294 |
export wadir="${EROOT}usr/libexec/webmin" |
295 |
export config_dir="${EROOT}etc/webmin" |
296 |
export var_dir="${EROOT}var/log/webmin" |
297 |
export tempdir="${T}" |
298 |
export pidfile="${EROOT}var/run/webmin.pid" |
299 |
export perl="$( which perl )" |
300 |
export os_type='gentoo-linux' |
301 |
export os_version='*' |
302 |
export real_os_type='Gentoo Linux' |
303 |
export real_os_version='Any version' |
304 |
# Forcing 'ssl' and 'ssl_redirect' for tightening security |
305 |
export ssl=1 |
306 |
export ssl_redirect=1 |
307 |
export keyfile="${EROOT}etc/ssl/webmin/server.pem" |
308 |
export port=10000 |
309 |
|
310 |
export atboot=0 |
311 |
|
312 |
einfo "Executing Webmin's configure script" |
313 |
$wadir/gentoo-setup.sh |
314 |
|
315 |
einfo "Configuration of Webmin done" |
316 |
} |
317 |
|
318 |
|
319 |
|
320 |
1.1 app-admin/webmin/webmin-1.560-r1.ebuild |
321 |
|
322 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/webmin-1.560-r1.ebuild?rev=1.1&view=markup |
323 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/webmin-1.560-r1.ebuild?rev=1.1&content-type=text/plain |
324 |
|
325 |
Index: webmin-1.560-r1.ebuild |
326 |
=================================================================== |
327 |
# Copyright 1999-2011 Gentoo Foundation |
328 |
# Distributed under the terms of the GNU General Public License v2 |
329 |
# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/webmin-1.560-r1.ebuild,v 1.1 2011/12/31 18:33:39 idl0r Exp $ |
330 |
|
331 |
EAPI="3" |
332 |
|
333 |
inherit eutils pam ssl-cert |
334 |
|
335 |
DESCRIPTION="A web-based Unix systems administration interface" |
336 |
HOMEPAGE="http://www.webmin.com/" |
337 |
SRC_URI="minimal? ( mirror://sourceforge/webadmin/${P}-minimal.tar.gz ) |
338 |
!minimal? ( mirror://sourceforge/webadmin/${P}.tar.gz )" |
339 |
|
340 |
LICENSE="BSD" |
341 |
SLOT="0" |
342 |
|
343 |
KEYWORDS="~amd64 ~x86" |
344 |
|
345 |
# NOTE: The ssl flag auto added by ssl-cert eclass is not used actually |
346 |
# because openssl is forced by dev-perl/Net-SSLeay |
347 |
IUSE="minimal +ssl mysql postgres ldap" |
348 |
|
349 |
# All the required perl modules can be found easily using (in Webmin's root src dir): |
350 |
# find . -name cpan_modules.pl -exec grep "::" {} \; |
351 |
# NOTE: If Webmin doesn't find the required perl modules, it offers(runtime) the user |
352 |
# to install them using the in-built cpan module, and this will mess up perl on the system |
353 |
# That's why some modules are forced without a use flag |
354 |
# NOTE: pam and ssl deps are forced for security and Gentoo compliance installation reasons |
355 |
DEPEND="virtual/perl-Sys-Syslog |
356 |
virtual/perl-Time-HiRes |
357 |
virtual/perl-Time-Local |
358 |
dev-perl/Authen-Libwrap |
359 |
dev-perl/IO-Tty |
360 |
dev-perl/MD5 |
361 |
dev-perl/Net-SSLeay |
362 |
dev-perl/Authen-PAM |
363 |
dev-perl/Sys-Hostname-Long |
364 |
!minimal? ( |
365 |
mysql? ( dev-perl/DBD-mysql ) |
366 |
postgres? ( dev-perl/DBD-Pg ) |
367 |
ldap? ( dev-perl/perl-ldap ) |
368 |
dev-perl/XML-Generator |
369 |
dev-perl/XML-Parser |
370 |
)" |
371 |
RDEPEND="${DEPEND}" |
372 |
|
373 |
src_prepare() { |
374 |
local perl="$( which perl )" |
375 |
|
376 |
# Remove the unnecessary and incompatible files |
377 |
rm -rf acl/Authen-SolarisRBAC-0.1* |
378 |
if ! use minimal ; then |
379 |
rm -rf {format,{bsd,hpux,sgi}exports,zones,rbac} |
380 |
rm -f mount/{free,net,open}bsd-mounts* |
381 |
rm -f mount/macos-mounts* |
382 |
fi |
383 |
|
384 |
# For security reasons remove the SSL certificate that comes with Webmin |
385 |
# We will create our own later |
386 |
rm -f miniserv.pem |
387 |
|
388 |
# Remove the Webmin setup scripts to avoid Webmin in runtime to mess up config |
389 |
# We will use our own later |
390 |
rm -f setup.{sh,pl} |
391 |
|
392 |
# Fix the permissions of the install files |
393 |
chmod -R og-w "${S}" |
394 |
|
395 |
# Since we should not modify any files after install |
396 |
# we set the perl path in all cgi and pl files here using Webmin's routines |
397 |
# The pl file is Prefix safe and works only on provided input, no other filesystem files |
398 |
ebegin "Fixing perl path in source files" |
399 |
(find "${S}" -name '*.cgi' -print ; find "${S}" -name '*.pl' -print) | $perl "${S}"/perlpath.pl $perl - |
400 |
eend $? |
401 |
} |
402 |
|
403 |
src_install() { |
404 |
# Create config dir and keep |
405 |
diropts -m0755 |
406 |
dodir /etc/webmin |
407 |
keepdir /etc/webmin |
408 |
|
409 |
# Create install dir |
410 |
# Third party modules installed through Webmin go here too, so keep |
411 |
dodir /usr/libexec/webmin |
412 |
keepdir /usr/libexec/webmin |
413 |
|
414 |
# Copy our own setup script to installation folder |
415 |
insinto /usr/libexec/webmin |
416 |
newins "${FILESDIR}"/gentoo-setup gentoo-setup.sh |
417 |
fperms 0744 /usr/libexec/webmin/gentoo-setup.sh |
418 |
|
419 |
# This is here if we ever want in future ebuilds to add some specific |
420 |
# config values in the /etc/webmin/miniserv.conf |
421 |
# The format of this file should be the same as the one of miniserv.conf: |
422 |
# var=value |
423 |
# |
424 |
# Uncomment it if you use such file. Before that check if upstream |
425 |
# has this file in root dir too. |
426 |
#newins "${FILESDIR}/miniserv-conf" miniserv-conf |
427 |
|
428 |
# Create the log dir and keep |
429 |
diropts -m0700 |
430 |
dodir /var/log/webmin |
431 |
keepdir /var/log/webmin |
432 |
|
433 |
# Create the init.d file and put the neccessary variables there |
434 |
newinitd "${FILESDIR}"/init.d.webmin webmin |
435 |
sed -i \ |
436 |
-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \ |
437 |
-e "s:%pid%:${EROOT}var/run/webmin.pid:" \ |
438 |
-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \ |
439 |
-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \ |
440 |
"${ED}etc/init.d/webmin" \ |
441 |
|| die "Failed to patch the webmin init file" |
442 |
|
443 |
# Setup pam |
444 |
pamd_mimic system-auth webmin auth account session |
445 |
|
446 |
# Copy files to installation folder |
447 |
ebegin "Copying install files to destination" |
448 |
cp -pPR "${S}"/* "${ED}usr/libexec/webmin" |
449 |
eend $? |
450 |
} |
451 |
|
452 |
pkg_preinst() { |
453 |
# First stop service if running so Webmin to not messup our config |
454 |
ebegin "Stopping any running Webmin instance prior merging" |
455 |
rc-service --ifexists -- webmin --ifstarted stop |
456 |
eend $? |
457 |
} |
458 |
|
459 |
pkg_postinst() { |
460 |
# Run pkg_config phase first - non interactively |
461 |
export INTERACTIVE="no" |
462 |
pkg_config |
463 |
# Every next time pkg_config should be interactive |
464 |
INTERACTIVE="yes" |
465 |
|
466 |
ewarn |
467 |
ewarn "Bare in mind that not all Webmin modules are Gentoo tweaked and may have some issues." |
468 |
ewarn "Always be careful when using modules that modify init entries, do update of webmin, install CPAN modules etc." |
469 |
ewarn "To avoid problems, please before using any module, look at its configuration options first." |
470 |
ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)" |
471 |
ewarn |
472 |
elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'" |
473 |
elog "- The default URL to connect to Webmin is: https://localhost:10000" |
474 |
elog "- The default user that can login is: root" |
475 |
elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'" |
476 |
} |
477 |
|
478 |
pkg_prerm() { |
479 |
# First stop service if running - we do not want Webmin to mess up config |
480 |
ebegin "Stopping any running Webmin instance prior unmerging" |
481 |
rc-service --ifexists -- webmin --ifstarted stop |
482 |
eend $? |
483 |
} |
484 |
|
485 |
pkg_postrm() { |
486 |
ewarn |
487 |
ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled" |
488 |
ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing." |
489 |
ewarn "To fix this just disable them if you intend to use Webmin again," |
490 |
ewarn "OR delete them if not." |
491 |
ewarn |
492 |
} |
493 |
|
494 |
pkg_config(){ |
495 |
# First stop service if running |
496 |
ebegin "Stopping any running Webmin instance" |
497 |
rc-service --ifexists -- webmin --ifstarted stop |
498 |
eend $? |
499 |
|
500 |
# Next set the default reset variable to 'none' |
501 |
# reset/_reset can be: |
502 |
# 'none' - does not reset anything, just upgrades if a conf is present |
503 |
# OR installs new conf if a conf is missing |
504 |
# 'soft' - deletes only $config_dir/config file and thus resetting most |
505 |
# conf values to their defaults. Keeps the specific Webmin cron jobs |
506 |
# 'hard' - deletes all files in $config_dir (keeping the .keep_* Gentoo file) |
507 |
# and thus resetting all Webmin. Deletes the specific Webmin cron jobs too. |
508 |
local _reset="none" |
509 |
|
510 |
# If in interactive mode ask user what should we do |
511 |
if [[ "${INTERACTIVE}" = "yes" ]]; then |
512 |
einfo |
513 |
einfo "Please enter the number of the action you would like to perform?" |
514 |
einfo |
515 |
einfo "1. Update configuration" |
516 |
einfo " (keeps old config options and adds the new ones)" |
517 |
einfo "2. Soft reset configuration" |
518 |
einfo " (keeps some old config options, the other options are set to default)" |
519 |
ewarn " All Webmin users will be reset" |
520 |
einfo "3. Hard reset configuration" |
521 |
einfo " (all options including module options are set to default)" |
522 |
ewarn " You will lose all Webmin configuration options you have done till now" |
523 |
einfo "4. Exit this configuration utility (default)" |
524 |
while [ "$correct" != "true" ] ; do |
525 |
read answer |
526 |
if [[ "$answer" = "1" ]] ; then |
527 |
_reset="none" |
528 |
correct="true" |
529 |
elif [[ "$answer" = "2" ]] ; then |
530 |
_reset="soft" |
531 |
correct="true" |
532 |
elif [[ "$answer" = "3" ]] ; then |
533 |
_reset="hard" |
534 |
correct="true" |
535 |
elif [ "$answer" = "4" -o "$answer" = "" ] ; then |
536 |
die "User aborted configuration." |
537 |
else |
538 |
echo "Answer not recognized. Enter a number from 1 to 4" |
539 |
fi |
540 |
done |
541 |
|
542 |
if [[ "$_reset" = "hard" ]]; then |
543 |
while [ "$sure" != "true" ] ; do |
544 |
ewarn "You will lose all Webmin configuration options you have done till now." |
545 |
ewarn "Are you sure you want to do this? (y/n)" |
546 |
read answer |
547 |
if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then |
548 |
sure="true" |
549 |
elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then |
550 |
die "User aborted configuration." |
551 |
else |
552 |
echo "Answer not recognized. Enter 'y' or 'n'" |
553 |
fi |
554 |
done |
555 |
fi |
556 |
fi |
557 |
|
558 |
export reset=$_reset |
559 |
|
560 |
# Create ssl certificate for Webmin if there is not one in the proper place |
561 |
if [[ ! -e "${EROOT}etc/ssl/webmin/server.pem" ]]; then |
562 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Webmin Server}" |
563 |
SSL_COMMONNAME="${SSL_COMMONNAME:-*}" |
564 |
install_cert "${EROOT}/etc/ssl/webmin/server" |
565 |
fi |
566 |
|
567 |
# Ensure all paths passed to the setup script use EROOT |
568 |
export wadir="${EROOT}usr/libexec/webmin" |
569 |
export config_dir="${EROOT}etc/webmin" |
570 |
export var_dir="${EROOT}var/log/webmin" |
571 |
export tempdir="${T}" |
572 |
export pidfile="${EROOT}var/run/webmin.pid" |
573 |
export perl="$( which perl )" |
574 |
export os_type='gentoo-linux' |
575 |
export os_version='*' |
576 |
export real_os_type='Gentoo Linux' |
577 |
export real_os_version='Any version' |
578 |
# Forcing 'ssl' and 'ssl_redirect' for tightening security |
579 |
export ssl=1 |
580 |
export ssl_redirect=1 |
581 |
export keyfile="${EROOT}etc/ssl/webmin/server.pem" |
582 |
export port=10000 |
583 |
|
584 |
export atboot=0 |
585 |
|
586 |
einfo "Executing Webmin's configure script" |
587 |
$wadir/gentoo-setup.sh |
588 |
|
589 |
einfo "Configuration of Webmin done" |
590 |
} |