3 # This script should be run after the webmin archive is unpacked, in order
4 # to setup the various config files
6 # Find install directory
10 if [ -x /bin/pwd ]; then
16 ver=`cat "$wadir/version"`
19 if [ "$tempdir" = "" ]; then
23 if [ $? != "0" ]; then
24 echo "ERROR: Cannot find the Webmin install directory";
29 echo "***********************************************************************"
30 echo "* Welcome to the Webmin setup script, version $ver *"
31 echo "***********************************************************************"
32 echo "Webmin is a web-based interface that allows Unix-like operating"
33 echo "systems and common Unix services to be easily administered."
36 # Only root can run this
37 id | grep "uid=0(" >/dev/null
38 if [ $? != "0" ]; then
39 uname -a | grep -i CYGWIN >/dev/null
40 if [ $? != "0" ]; then
41 echo "ERROR: The Webmin install script must be run as root";
47 # Use the supplied destination directory, if any
48 if [ "$1" != "" ]; then
50 echo "Installing Webmin from $srcdir to $wadir ..."
51 if [ ! -d "$wadir" ]; then
53 if [ "$?" != "0" ]; then
54 echo "ERROR: Failed to create $wadir"
59 # Make sure dest dir is not in use
60 ls "$wadir" | grep -v rpmsave >/dev/null 2>&1
61 if [ "$?" = "0" -a ! -r "$wadir/setup.sh" ]; then
62 echo "ERROR: Installation directory $wadir contains other files"
68 echo "Installing Webmin in $wadir ..."
72 # Work out perl library path
74 if [ "$perllib" != "" ]; then
75 PERLLIB="$PERLLIB:$perllib"
78 # Validate source directory
79 allmods=`cd "$srcdir"; echo */module.info | sed -e 's/\/module.info//g'`
80 if [ "$allmods" = "" ]; then
81 echo "ERROR: Failed to get module list"
87 # Load package-defined variable overrides
88 if [ -r "$srcdir/setup-pre.sh" ]; then
89 . "$srcdir/setup-pre.sh"
92 # Ask for webmin config directory
93 echo "***********************************************************************"
94 echo "Webmin uses separate directories for configuration files and log files."
95 echo "Unless you want to run multiple versions of Webmin at the same time"
96 echo "you can just accept the defaults."
98 printf "Config file directory [/etc/webmin]: "
99 if [ "$config_dir" = "" ]; then
102 if [ "$config_dir" = "" ]; then
103 config_dir=/etc/webmin
105 abspath=`echo $config_dir | grep "^/"`
106 if [ "$abspath" = "" ]; then
107 echo "Config directory must be an absolute path"
111 if [ ! -d $config_dir ]; then
114 echo "ERROR: Failed to create directory $config_dir"
119 if [ -r "$config_dir/config" ]; then
120 echo "Found existing Webmin configuration in $config_dir"
125 # Check if upgrading from an old version
126 if [ "$upgrading" = 1 ]; then
129 # Get current var path
130 var_dir=`cat $config_dir/var-path`
132 # Force creation if non-existant
133 mkdir -p $var_dir >/dev/null 2>&1
135 # Get current perl path
136 perl=`cat $config_dir/perl-path`
138 # Create temp files directory
139 $perl "$srcdir/maketemp.pl"
140 if [ "$?" != "0" ]; then
141 echo "ERROR: Failed to create or check temp files directory $tempdir"
146 # Get old os name and version
147 os_type=`grep "^os_type=" $config_dir/config | sed -e 's/os_type=//g'`
148 os_version=`grep "^os_version=" $config_dir/config | sed -e 's/os_version=//g'`
149 real_os_type=`grep "^real_os_type=" $config_dir/config | sed -e 's/real_os_type=//g'`
150 real_os_version=`grep "^real_os_version=" $config_dir/config | sed -e 's/real_os_version=//g'`
152 # Get old root, host, port, ssl and boot flag
153 oldwadir=`grep "^root=" $config_dir/miniserv.conf | sed -e 's/root=//g'`
154 port=`grep "^port=" $config_dir/miniserv.conf | sed -e 's/port=//g'`
155 ssl=`grep "^ssl=" $config_dir/miniserv.conf | sed -e 's/ssl=//g'`
156 atboot=`grep "^atboot=" $config_dir/miniserv.conf | sed -e 's/atboot=//g'`
157 inetd=`grep "^inetd=" $config_dir/miniserv.conf | sed -e 's/inetd=//g'`
159 if [ "$inetd" != "1" ]; then
161 $config_dir/stop >/dev/null 2>&1
164 # Copy files to target directory
165 if [ "$wadir" != "$srcdir" ]; then
166 echo "Copying files to $wadir .."
167 (cd "$srcdir" ; tar cf - . | (cd "$wadir" ; tar xf -))
173 $perl "$wadir/newmods.pl" $config_dir $allmods
175 # Update miniserv.conf with new root directory and mime types file
176 grep -v "^root=" $config_dir/miniserv.conf | grep -v "^mimetypes=" | grep -v "^server=" >$tempdir/$$.miniserv.conf
177 if [ $? != "0" ]; then exit 1; fi
178 mv $tempdir/$$.miniserv.conf $config_dir/miniserv.conf
179 echo "root=$wadir" >> $config_dir/miniserv.conf
180 echo "mimetypes=$wadir/mime.types" >> $config_dir/miniserv.conf
181 echo "server=MiniServ/$ver" >> $config_dir/miniserv.conf
182 grep logout= $config_dir/miniserv.conf >/dev/null
183 if [ $? != "0" ]; then
184 echo "logout=$config_dir/logout-flag" >> $config_dir/miniserv.conf
187 # Check for third-party modules in old version
188 if [ "$wadir" != "$oldwadir" ]; then
189 echo "Checking for third-party modules .."
190 if [ "$webmin_upgrade" != "" ]; then
193 $perl "$wadir/thirdparty.pl" "$wadir" "$oldwadir" $autothird
198 # Remove old cache of module infos
199 rm -f $config_dir/module.infos.cache
201 # Config directory exists .. make sure it is not in use
202 ls $config_dir | grep -v rpmsave >/dev/null 2>&1
203 if [ "$?" = "0" -a "$config_dir" != "/etc/webmin" ]; then
204 echo "ERROR: Config directory $config_dir is not empty"
209 # Ask for log directory
210 printf "Log file directory [/var/webmin]: "
211 if [ "$var_dir" = "" ]; then
214 if [ "$var_dir" = "" ]; then
217 abspath=`echo $var_dir | grep "^/"`
218 if [ "$abspath" = "" ]; then
219 echo "Log file directory must be an absolute path"
223 if [ "$var_dir" = "/" ]; then
224 echo "Log directory cannot be /"
228 if [ ! -d $var_dir ]; then
231 echo "ERROR: Failed to create directory $var_dir"
238 # Ask where perl is installed
239 echo "***********************************************************************"
240 echo "Webmin is written entirely in Perl. Please enter the full path to the"
241 echo "Perl 5 interpreter on your system."
243 if [ -x /usr/bin/perl ]; then
244 perldef=/usr/bin/perl
245 elif [ -x /usr/local/bin/perl ]; then
246 perldef=/usr/local/bin/perl
250 if [ "$perl" = "" ]; then
251 if [ "$perldef" = "" ]; then
252 printf "Full path to perl: "
254 if [ "$perl" = "" ]; then
255 echo "ERROR: No path entered!"
260 printf "Full path to perl (default $perldef): "
262 if [ "$perl" = "" ]; then
270 echo "Testing Perl ..."
271 if [ ! -x $perl ]; then
272 echo "ERROR: Failed to find perl at $perl"
276 $perl -e 'print "foobar\n"' 2>/dev/null | grep foobar >/dev/null
277 if [ $? != "0" ]; then
278 echo "ERROR: Failed to run test perl script. Maybe $perl is"
279 echo "not the perl interpreter, or is not installed properly"
283 $perl -e 'exit ($] < 5.002 ? 1 : 0)'
284 if [ $? = "1" ]; then
285 echo "ERROR: Detected old perl version. Webmin requires"
286 echo "perl 5.002 or better to run"
290 $perl -e 'use Socket; print "foobar\n"' 2>/dev/null | grep foobar >/dev/null
291 if [ $? != "0" ]; then
292 echo "ERROR: Perl Socket module not installed. Maybe Perl has"
293 echo "not been properly installed on your system"
297 $perl -e '$c = crypt("xx", "yy"); exit($c ? 0 : 1)'
298 if [ $? != "0" ]; then
299 $perl -e 'use Crypt::UnixCrypt' >/dev/null 2>&1
301 if [ $? != "0" ]; then
302 echo "ERROR: Perl crypt function does not work. Maybe Perl has"
303 echo "not been properly installed on your system"
307 echo "Perl seems to be installed ok"
310 # Create temp files directory
311 $perl "$srcdir/maketemp.pl"
312 if [ "$?" != "0" ]; then
313 echo "ERROR: Failed to create or check temp files directory $tempdir"
318 # Ask for operating system type
319 echo "***********************************************************************"
320 if [ "$os_type" = "" ]; then
321 if [ "$autoos" = "" ]; then
324 $perl "$srcdir/oschooser.pl" "$srcdir/os_list.txt" $tempdir/$$.os $autoos
331 echo "Operating system name: $real_os_type"
332 echo "Operating system version: $real_os_version"
335 # Ask for web server port, name and password
336 echo "***********************************************************************"
337 echo "Webmin uses its own password protected web server to provide access"
338 echo "to the administration programs. The setup script needs to know :"
339 echo " - What port to run the web server on. There must not be another"
340 echo " web server already using this port."
341 echo " - The login name required to access the web server."
342 echo " - The password required to access the web server."
343 echo " - If the webserver should use SSL (if your system supports it)."
344 echo " - Whether to start webmin at boot time."
346 printf "Web server port (default 10000): "
347 if [ "$port" = "" ]; then
349 if [ "$port" = "" ]; then
353 if [ $port -lt 1 ]; then
354 echo "ERROR: $port is not a valid port number"
358 if [ $port -gt 65535 ]; then
359 echo "ERROR: $port is not a valid port number. Port numbers cannot be"
360 echo " greater than 65535"
364 $perl -e 'use Socket; socket(FOO, PF_INET, SOCK_STREAM, getprotobyname("tcp")); setsockopt(FOO, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); bind(FOO, pack_sockaddr_in($ARGV[0], INADDR_ANY)) || exit(1); exit(0);' $port
365 if [ $? != "0" ]; then
366 echo "ERROR: TCP port $port is already in use by another program"
370 printf "Login name (default admin): "
371 if [ "$login" = "" ]; then
373 if [ "$login" = "" ]; then
377 echo "$login" | grep : >/dev/null
378 if [ "$?" = "0" ]; then
379 echo "ERROR: Username contains a : character"
383 echo $login | grep " " >/dev/null
384 if [ "$?" = "0" ]; then
385 echo "ERROR: Username contains a space"
389 if [ "$login" = "webmin" ]; then
390 echo "ERROR: Username 'webmin' is reserved for internal use"
394 printf "Login password: "
395 if [ "$password" = "" -a "$crypt" = "" ]; then
400 printf "Password again: "
405 if [ "$password" != "$password2" ]; then
406 echo "ERROR: Passwords don't match"
410 echo $password | grep : >/dev/null
411 if [ "$?" = "0" ]; then
412 echo "ERROR: Password contains a : character"
418 # Ask the user if SSL should be used
419 if [ "$ssl" = "" ]; then
421 $perl -e 'use Net::SSLeay' >/dev/null 2>/dev/null
422 if [ $? = "0" ]; then
423 printf "Use SSL (y/n): "
425 if [ "$sslyn" = "y" -o "$sslyn" = "Y" ]; then
429 echo "The Perl SSLeay library is not installed. SSL not available."
434 # Don't use SSL if missing Net::SSLeay
435 if [ "$ssl" = "1" ]; then
436 $perl -e 'use Net::SSLeay' >/dev/null 2>/dev/null
437 if [ $? != "0" ]; then
442 # Ask whether to run at boot time
443 if [ "$atboot" = "" ]; then
444 initsupp=`grep "^os_support=" "$srcdir/init/module.info" | sed -e 's/os_support=//g' | grep $os_type`
446 if [ "$initsupp" != "" ]; then
447 printf "Start Webmin at boot time (y/n): "
449 if [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then
453 echo "Webmin does not support being started at boot time on your system."
458 # Copy files to target directory
459 echo "***********************************************************************"
460 if [ "$wadir" != "$srcdir" ]; then
461 echo "Copying files to $wadir .."
462 (cd "$srcdir" ; tar cf - . | (cd "$wadir" ; tar xf -))
467 # Create webserver config file
468 echo $perl > $config_dir/perl-path
469 echo $var_dir > $config_dir/var-path
470 echo "Creating web server config files.."
471 cfile=$config_dir/miniserv.conf
472 echo "port=$port" >> $cfile
473 echo "root=$wadir" >> $cfile
474 echo "mimetypes=$wadir/mime.types" >> $cfile
475 echo "addtype_cgi=internal/cgi" >> $cfile
476 echo "realm=Webmin Server" >> $cfile
477 echo "logfile=$var_dir/miniserv.log" >> $cfile
478 echo "errorlog=$var_dir/miniserv.error" >> $cfile
479 echo "pidfile=$var_dir/miniserv.pid" >> $cfile
480 echo "logtime=168" >> $cfile
481 echo "ppath=$ppath" >> $cfile
482 echo "ssl=$ssl" >> $cfile
483 echo "env_WEBMIN_CONFIG=$config_dir" >> $cfile
484 echo "env_WEBMIN_VAR=$var_dir" >> $cfile
485 echo "atboot=$atboot" >> $cfile
486 echo "logout=$config_dir/logout-flag" >> $cfile
487 if [ "$listen" != "" ]; then
488 echo "listen=$listen" >> $cfile
490 echo "listen=10000" >> $cfile
492 echo "denyfile=\\.pl\$" >> $cfile
493 echo "log=1" >> $cfile
494 echo "blockhost_failures=5" >> $cfile
495 echo "blockhost_time=60" >> $cfile
496 echo "syslog=1" >> $cfile
497 if [ "$allow" != "" ]; then
498 echo "allow=$allow" >> $cfile
500 if [ "$session" != "" ]; then
501 echo "session=$session" >> $cfile
503 echo "session=1" >> $cfile
505 if [ "$pam" != "" ]; then
506 echo "pam=$pam" >> $cfile
508 echo premodules=WebminCore >> $cfile
509 echo "server=MiniServ/$ver" >> $cfile
511 # Append package-specific info to config file
512 if [ -r "$wadir/miniserv-conf" ]; then
513 cat "$wadir/miniserv-conf" >>$cfile
516 md5pass=`$perl -e 'print crypt("test", "\\$1\\$A9wB3O18\\$zaZgqrEmb9VNltWTL454R/") eq "\\$1\\$A9wB3O18\\$zaZgqrEmb9VNltWTL454R/" ? "1\n" : "0\n"'`
518 ufile=$config_dir/miniserv.users
519 if [ "$crypt" != "" ]; then
520 echo "$login:$crypt:0" > $ufile
522 if [ "$md5pass" = "1" ]; then
523 $perl -e 'print "$ARGV[0]:",crypt($ARGV[1], "\$1\$XXXXXXXX"),":0\n"' "$login" "$password" > $ufile
525 $perl -e 'print "$ARGV[0]:",crypt($ARGV[1], "XX"),":0\n"' "$login" "$password" > $ufile
529 echo "userfile=$ufile" >> $cfile
531 kfile=$config_dir/miniserv.pem
532 openssl version >/dev/null 2>&1
533 if [ "$?" = "0" ]; then
534 # We can generate a new SSL key for this host
536 openssl req -newkey rsa:512 -x509 -nodes -out $tempdir/cert -keyout $tempdir/key -days 1825 >/dev/null 2>&1 <<EOF
540 Webmin Webserver on $host
545 if [ "$?" = "0" ]; then
546 cat $tempdir/cert $tempdir/key >$kfile
548 rm -f $tempdir/cert $tempdir/key
550 if [ ! -r $kfile ]; then
551 # Fall back to the built-in key
552 cp "$wadir/miniserv.pem" $kfile
555 echo "keyfile=$config_dir/miniserv.pem" >> $cfile
561 echo "Creating access control file.."
562 afile=$config_dir/webmin.acl
564 if [ "$defaultmods" = "" ]; then
565 echo "$login: $allmods" >> $afile
567 echo "$login: $defaultmods" >> $afile
573 if [ "$login" != "root" -a "$login" != "admin" ]; then
574 # Allow use of RPC by this user
575 echo rpc=1 >>$config_dir/$login.acl
579 if [ "$noperlpath" = "" ]; then
580 echo "Inserting path to perl into scripts.."
581 (find "$wadir" -name '*.cgi' -print ; find "$wadir" -name '*.pl' -print) | $perl "$wadir/perlpath.pl" $perl -
586 echo "Creating start and stop scripts.."
587 rm -f $config_dir/stop $config_dir/start $config_dir/restart $config_dir/reload
588 echo "#!/bin/sh" >>$config_dir/start
589 echo "echo Starting Webmin server in $wadir" >>$config_dir/start
590 echo "trap '' 1" >>$config_dir/start
591 echo "LANG=" >>$config_dir/start
592 echo "export LANG" >>$config_dir/start
593 echo "#PERLIO=:raw" >>$config_dir/start
594 echo "unset PERLIO" >>$config_dir/start
595 echo "export PERLIO" >>$config_dir/start
596 echo "PERLLIB=$PERLLIB" >>$config_dir/start
597 echo "export PERLLIB" >>$config_dir/start
598 uname -a | grep -i 'HP/*UX' >/dev/null
599 if [ $? = "0" ]; then
600 echo "exec '$wadir/miniserv.pl' $config_dir/miniserv.conf &" >>$config_dir/start
602 echo "exec '$wadir/miniserv.pl' $config_dir/miniserv.conf" >>$config_dir/start
605 echo "#!/bin/sh" >>$config_dir/stop
606 echo "echo Stopping Webmin server in $wadir" >>$config_dir/stop
607 echo "pidfile=\`grep \"^pidfile=\" $config_dir/miniserv.conf | sed -e 's/pidfile=//g'\`" >>$config_dir/stop
608 echo "kill \`cat \$pidfile\`" >>$config_dir/stop
610 echo "#!/bin/sh" >>$config_dir/restart
611 echo "$config_dir/stop && $config_dir/start" >>$config_dir/restart
613 echo "#!/bin/sh" >>$config_dir/reload
614 echo "echo Reloading Webmin server in $wadir" >>$config_dir/reload
615 echo "pidfile=\`grep \"^pidfile=\" $config_dir/miniserv.conf | sed -e 's/pidfile=//g'\`" >>$config_dir/reload
616 echo "kill -USR1 \`cat \$pidfile\`" >>$config_dir/reload
618 chmod 755 $config_dir/start $config_dir/stop $config_dir/restart $config_dir/reload
622 if [ "$upgrading" = 1 ]; then
623 echo "Updating config files.."
625 echo "Copying config files.."
627 newmods=`$perl "$wadir/copyconfig.pl" "$os_type/$real_os_type" "$os_version/$real_os_version" "$wadir" $config_dir "" $allmods`
628 if [ "$upgrading" != 1 ]; then
629 # Store the OS and version
630 echo "os_type=$os_type" >> $config_dir/config
631 echo "os_version=$os_version" >> $config_dir/config
632 echo "real_os_type=$real_os_type" >> $config_dir/config
633 echo "real_os_version=$real_os_version" >> $config_dir/config
634 if [ -r /etc/system.cnf ]; then
635 # Found a caldera system config file .. get the language
636 source /etc/system.cnf
637 if [ "$CONF_LST_LANG" = "us" ]; then
639 elif [ "$CONF_LST_LANG" = "uk" ]; then
642 grep "lang=$CONF_LST_LANG," "$wadir/lang_list.txt" >/dev/null 2>&1
643 if [ "$?" = 0 ]; then
644 echo "lang=$CONF_LST_LANG" >> $config_dir/config
648 # Turn on logging by default
649 echo "log=1" >> $config_dir/config
651 # Use licence module specified by environment variable
652 if [ "$licence_module" != "" ]; then
653 echo licence_module=$licence_module >>$config_dir/config
656 # Disallow unknown referers by default
657 echo "referers_none=1" >>$config_dir/config
659 # one-off hack to set log variable in config from miniserv.conf
660 grep log= $config_dir/config >/dev/null
661 if [ "$?" = "1" ]; then
662 grep log= $config_dir/miniserv.conf >> $config_dir/config
663 grep logtime= $config_dir/miniserv.conf >> $config_dir/config
664 grep logclear= $config_dir/miniserv.conf >> $config_dir/config
667 # Disallow unknown referers if not set
668 grep referers_none= $config_dir/config >/dev/null
669 if [ "$?" != "0" ]; then
670 echo "referers_none=1" >>$config_dir/config
673 echo $ver > $config_dir/version
677 # Set passwd_ fields in miniserv.conf from global config
678 for field in passwd_file passwd_uindex passwd_pindex passwd_cindex passwd_mindex; do
679 grep $field= $config_dir/miniserv.conf >/dev/null
680 if [ "$?" != "0" ]; then
681 grep $field= $config_dir/config >> $config_dir/miniserv.conf
684 grep passwd_mode= $config_dir/miniserv.conf >/dev/null
685 if [ "$?" != "0" ]; then
686 echo passwd_mode=0 >> $config_dir/miniserv.conf
689 # If Perl crypt supports MD5, then make it the default
690 if [ "$md5pass" = "1" ]; then
691 echo md5pass=1 >> $config_dir/config
694 # Set a special theme if none was set before
695 if [ "$theme" = "" ]; then
696 theme=`cat "$wadir/defaulttheme" 2>/dev/null`
698 oldthemeline=`grep "^theme=" $config_dir/config`
699 oldtheme=`echo $oldthemeline | sed -e 's/theme=//g'`
700 if [ "$theme" != "" ] && [ "$oldthemeline" = "" ] && [ -d "$wadir/$theme" ]; then
704 # Set a special overlay if none was set before
705 if [ "$overlay" = "" ]; then
706 overlay=`cat "$wadir/defaultoverlay" 2>/dev/null`
708 if [ "$overlay" != "" ] && [ "$theme" != "" ] && [ -d "$wadir/$overlay" ]; then
709 themelist="$themelist $overlay"
712 # Apply the theme and maybe overlay
713 if [ "$themelist" != "" ]; then
714 echo "theme=$themelist" >> $config_dir/config
715 echo "preroot=$themelist" >> $config_dir/miniserv.conf
718 # Set the product field in the global config
719 grep product= $config_dir/config >/dev/null
720 if [ "$?" != "0" ]; then
721 echo product=webmin >> $config_dir/config
724 if [ "$makeboot" = "1" ]; then
725 echo "Configuring Webmin to start at boot time.."
726 (cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/atboot.pl" $bootscript)
731 # If password delays are not specifically disabled, enable them
732 grep passdelay= $config_dir/miniserv.conf >/dev/null
733 if [ "$?" != "0" ]; then
734 echo passdelay=1 >> $config_dir/miniserv.conf
737 if [ "$nouninstall" = "" ]; then
738 echo "Creating uninstall script $config_dir/uninstall.sh .."
739 cat >$config_dir/uninstall.sh <<EOF
741 printf "Are you sure you want to uninstall Webmin? (y/n) : "
744 if [ "\$answer" = "y" ]; then
746 echo "Running uninstall scripts .."
747 (cd "$wadir" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir LANG= "$wadir/run-uninstalls.pl")
748 echo "Deleting $wadir .."
750 echo "Deleting $config_dir .."
755 chmod +x $config_dir/uninstall.sh
760 echo "Changing ownership and permissions .."
761 # Make all config dirs non-world-readable
762 for m in $newmods; do
763 chown -R root $config_dir/$m
764 chgrp -R bin $config_dir/$m
765 chmod -R og-rw $config_dir/$m
767 # Make miniserv config files non-world-readable
768 for f in miniserv.conf miniserv.pem miniserv.users; do
769 chown -R root $config_dir/$f
770 chgrp -R bin $config_dir/$f
771 chmod -R og-rw $config_dir/$f
773 chmod +r $config_dir/version
774 if [ "$nochown" = "" ]; then
775 # Make program directory non-world-writable, but executable
776 chown -R root "$wadir"
777 chgrp -R bin "$wadir"
778 chmod -R og-w "$wadir"
779 chmod -R a+rx "$wadir"
781 if [ $var_dir != "/var" ]; then
782 # Make log directory non-world-readable or writable
783 chown -R root $var_dir
784 chgrp -R bin $var_dir
785 chmod -R og-rwx $var_dir
787 # Fix up bad permissions from some older installs
788 for m in ldap-client ldap-server ldap-useradmin mailboxes mysql postgresql servers virtual-server; do
789 if [ -d "$config_dir/$m" ]; then
790 chown root $config_dir/$m
791 chgrp bin $config_dir/$m
792 chmod og-rw $config_dir/$m
793 chmod og-rw $config_dir/$m/config 2>/dev/null
799 # Save target directory if one was specified
800 if [ "$wadir" != "$srcdir" ]; then
801 echo $wadir >$config_dir/install-dir
803 rm -f $config_dir/install-dir
806 if [ "$nopostinstall" = "" ]; then
807 echo "Running postinstall scripts .."
808 (cd "$wadir" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/run-postinstalls.pl")
813 # Enable background collection
814 if [ "$upgrading" != 1 ]; then
815 echo "Enabling background status collection .."
816 $config_dir/system-status/enable-collection.pl 5
821 # Run package-defined post-install script
822 if [ -r "$srcdir/setup-post.sh" ]; then
823 . "$srcdir/setup-post.sh"
826 if [ "$nostart" = "" ]; then
827 if [ "$inetd" != "1" ]; then
828 echo "Attempting to start Webmin mini web server.."
830 if [ $? != "0" ]; then
831 echo "ERROR: Failed to start web server!"
839 echo "***********************************************************************"
840 echo "Webmin has been installed and started successfully. Use your web"
841 echo "browser to go to"
844 if [ "$ssl" = "1" ]; then
845 echo " https://$host:$port/"
847 echo " http://$host:$port/"
850 echo "and login with the name and password you entered previously."
852 if [ "$ssl" = "1" ]; then
853 echo "Because Webmin uses SSL for encryption only, the certificate"
854 echo "it uses is not signed by one of the recognized CAs such as"
855 echo "Verisign. When you first connect to the Webmin server, your"
856 echo "browser will ask you if you want to accept the certificate"
857 echo "presented, as it does not recognize the CA. Say yes."
862 if [ "$oldwadir" != "$wadir" -a "$upgrading" = 1 -a "$deletedold" != 1 ]; then
863 echo "The directory from the previous version of Webmin"
865 echo "Can now be safely deleted to free up disk space, assuming"
866 echo "that all third-party modules have been copied to the new"