webmin 之 setup.sh 脚本分析

简介:
# find install directory 
None.gif
cd  ' dirname $0 '  
None.gif
if  [  -x   / bin / pwd ]; then 
None.gifwadir
= ' /bin/pwd '  
None.gif
else  
None.gifwadir
= ' pwd '
None.giffi 
None.gif
# 查找并获得安装目录 -> wadir 
None.gif
ver = ' cat $wadir/version '  
None.gif
# 获得安装版本 
None.gif
echo  " ***************** "  
None.gif
dot.gif.  
None.gif
# 显示用户提示信息 
None.gif
id  |   grep   " uid=1< "   >/ dev / null 
None.gif
if  [ $ ?   != " 0 "  ]; then 
None.gifecho 
" ERROR:dot.gif "
None.gifecho 
""
None.gif
exit   1
None.giffi 
None.gif
# 检查是否为root 安装否则提示出错,程序推出 
None.gif#才知道还有id 这么个命令,,见笑了 

None.gif
echo  " Installing webmin in $ wadir dot.gif "  
None.gifallmods
= ' cd $wadir; ls */module.info | sed -e  ' s /\/ module . info // g '  | xargs e 
None.gifcho
'  
None.gifecho 
""  
None.gif
# 获取所有的可安装模块信息 
None.gif

None.gif
printf   " Config file directory [/etc/webmin]: "  
None.gif
.  
None.gif
.  
None.gif
.  
None.gif
if  [  " $config_dir "   =   "" ]; then 
None.gifconfig_dir 
=   / etc / webmin 
None.giffi 
None.gif
#  询问配置文件目录 
None.gif
abspath = ' echo $config_dir | grep "^/" '  
None.gif
if  [  " $abspath "   =   ""  ]; then 
None.gifecho 
" Config directory must be an absolute path "  
None.gifecho 
""  
None.gif
exit   2  
None.giffi 
None.gif
# 检查配置文件目录是否合法 
None.gif
if  [  !   - $config_dir  ]; then 
None.gif
mkdir   $config_dir  
None.gif
if  [ $ ?   != 0  ]; then 
None.gifecho 
" ERROR: failed to create directory $config_dir "  
None.gifecho 
""  
None.gif
exit   2  
None.giffi 
None.giffi 
None.gif
# 创建配置目录,并检查是否成功 
None.gif
if  [  - " $config_dir/config "  ]; then 
None.gifecho 
" Found existing Webmin configuration in $config_dir "  
None.gifecho 
""  
None.gifupgrading
= 1  
None.giffi 
None.gif
# 检查配置文件是否存在,并置标志upgrading 
None.gif## 注,版本更新部分暂略 

None.gif

None.gifls 
$config_dir   |   grep   - v rpmsave  >/ dev / null  2 >& 1  
None.gif
if  [  " $? "   =   " 0 "   - " $config_dir "   !=   " /etc/webmin "  ]; then 
None.gifecho 
" dot.gif 
None.gifdot.gif
None.gifexit 2 
None.giffi 
None.gif#配置目录非空,退出配置 
None.gif#否则继续安装 
None.gifpirntf 
" Log  file directory [ / var / webmin] : "  
None.gifif [ 
" $var_dir "  =  ""  ]; then 
None.gifread var_dir 
None.giffi 
None.gifif [ 
" $var_dir "  =  ""  ]; then 
None.gifvar_dir=/var/webmin 
None.giffi 
None.gif#创建系统运行时目录 log directory 
None.gif#缺省使用/var/webmin 
None.gifabspath='echo $var_dir | grep 
" ^/ "
None.gifif [ 
"   & abspath  "  =  ""  ]; then 
None.gifecho 
" log  file d dot.gif.. "  
None.gifecho 
""  
None.gifecho 3 
None.giffi 
None.gif#检查该运行时文件目录是否合法,否则退出 
None.gif#grep 
" ^/ "  行首 以 " / " 开始 
None.gifif [ ! -d $var_dir ]; then 
None.gifmkdir $var_dir 
None.gifif [ $? !=0 ]; then 
None.gifehco 
" error :dot.gif "  
None.gif
None.gif
None.giffi 
None.giffi 
None.gif#运行时文件目录不存在,则创建之,若创建失败,退出 
None.gif
None.gif依靠perl 运行的webmin当然要确定一下系统中是否有perl 的解释器, 
None.gif以下: 
None.gifif [ -x /usr/bin/perl ]; then 
None.gifperldef=/usr/bin/perl 
None.gifelif [ -x /usr/local/bin/perl ]; then 
None.gifperldef=/usr/local/bin/perl 
None.gifelse 
None.gifperldef =
""  
None.giffi 
None.gif#检查几个常用perl安装路径是否有perl 存在,否则定义perldef变量为
""  
None.gifif [ 
" $perl "  =  ""  ]; then 
None.gifif [ 
" $perldef "  =  ""  ]; then 
None.gifread perl 
None.gifif [ 
" $perl "  =  ""  ];then 
None.gifecho 
" error :dot.gif "  
None.gifdot.gif
None.gifexit 4 
None.giffi 
None.gifelse 
None.gifprintf 
" Full path to perl  dot.gif "  
None.gif#提示输入 
None.gifread perl 
None.gifif [ 
" $perl "  =  "" ];then 
None.gifperl=$perldef 
None.giffi 
None.giffi 
None.giffi 
None.gif#上一步如果没有找到perl 的安装路径,则要求用户输入perl 的路径 
None.gif#有问题这里! perl & perldef ?! 真麻烦! 有一个不久行了吗?! 
None.gifif [ ! -x $perl ]; then 
None.gifecho 
" error :  message dot.gif "  
None.gifexit 5 
None.giffi 
None.gif# 没有perl环境, 退出 
None.gif$perl -e 'print 
" foobar \ n " ' 2>/dev/null | grep foobar >/dev/null 
None.gifif [ $? != 
" 0 "  ];then 
None.gifecho
" error dot.gif "  
None.gifexit 6 
None.giffi 
None.gif#否则测试perl 是否可以运行dot.gif(打印一行试试,并进行检测) 
None.gif$perl -e 'exit ($] < 5.002 ? 1:0)' 
None.gifif [ $? = 
" 1 "  ]; then 
None.gifecho 
" error  :  message dot.gif "  
None.gifexit 7 
None.giffi 
None.gif#检测版本信息,要求5.002 以上版本( 本setup.sh出自 ver0.88) 
None.gif$perl -e 'use Socket; print 
" foobar \ n " ' 2>/dev/null | grep foobar >/dev/null 
None.gifif [ $? != 
" 0 "  ];then 
None.gifecho 
" error mesage dot.gif. "  
None.gifexit 8 
None.giffi 
None.gif#检测socket 模块是否正确安装..否则退出 
None.gif$perl -e '$c = crypt(
" xx " , " yy " ); exit($c ? 0:1)' 
None.gifif [ $? != 
" 0 "  ]; then 
None.gifecho 
" erro mesage .. "  
None.gifeixt 9 
None.giffi 
None.gif#检测加密模块是否正确安装,否则退出 
None.gifecho 
"  Pelr seems to be installed ok "  
None.gifecho 
""  
None.gif#通知用户perl检测正常 
None.gif
None.gif
None.gif操作系统选择,见 oschooser.pl 和 os_list.txt 理的内容 
None.gifoschooser.pl 实现系统选择, 还没细看,大概就是根据不同的linux发 
None.gif布(因为它们的配置文件名会有所不同,怎么说,叫个案追究吧 呵呵) 
None.gif给webmin使用不同配置文件(参数变化) 
None.gif
None.gifprintf 
" Web server port (default  10000 ) :   "  
None.gifif [ 
" $port "  =  ""  ]; then 
None.gifread port 
None.gifif [ 
" $port "  =  ""  ]; then 
None.gifport=10000 
None.gif
None.giffi 
None.gif
None.giffi 
None.gifif [ $port -lt 1 ]; then 
None.gifecho 
" ERROR :   $port  is not a valid port number "  
None.gif
None.gifecho 
""  
None.gifexit 11 
None.giffi 
None.gif
None.gifif [ $port -gt 65535 ]; then 
None.gif
None.gifecho 
" ERROR :   $port  is not a valid port number .  Port numbers cannot be "  
None.gif
None.gifecho 
"  greater than  65535 "  
None.gifecho 
""  
None.gif
None.gifexit 12 
None.gif
None.giffi 
None.gif
None.gif$perl -e 'use Socket; socket(FOO, PF_INET, SOCK_STREAM, getprotobyname(
" tcp "  
None.gif)); 
None.gifsetsockopt(FOO, SOL_SOCKET, SO_REUSEADDR, pack(
" l " , 1)); 
None.gifbind(FOO, sockaddr_in($ARGV[0], INADDR_ANY)) || exit(1); 
None.gifexit(0);' 
None.gif$port 
None.gif
None.gifif [ $? != 
" 0 "  ]; then 
None.gif
None.gifecho 
" ERROR :  TCP port  $port  is already in  use  by another program "  
None.gif
None.gifecho 
""  
None.gif
None.gifexit 13 
None.gif
None.giffi 
None.gif
None.gifprintf 
" Login name (default admin) :   "  
None.gifif [ 
" $login "  =  ""  ]; then 
None.gif
None.gifread login 
None.gif
None.gifif [ 
" $login "  =  ""  ]; then 
None.gif
None.giflogin=
" admin "  
None.giffi 
None.gif
None.giffi 
None.gifecho $login | grep : >/dev/null 
None.gifif [ 
" $ ? "  =  " 0 "  ]; then 
None.gifecho 
" ERROR :  Username contains a  :  character "  
None.gif
None.gifecho 
""  
None.gif
None.gifexit 14 
None.gif
None.giffi 
None.gifprintf 
" Login password :   "  
None.gif
None.gifif [ 
" $password "  =  ""  -a  " $crypt "  =  ""  ]; then 
None.gifstty -echo 
None.gif
None.gifread password 
None.gif
None.gifstty echo 
None.gif
None.gifprintf 
" \ n "  
None.gif
None.gifprintf 
" Password again :   "  
None.gifstty -echo 
None.gif
None.gifread password2 
None.gif
None.gifstty echo 
None.gifprintf 
" \ n "  
None.gifif [ 
" $password "  !=  " $password2 "  ]; then 
None.gifecho 
" ERROR :  Passwords don ' t match" 
None.gifecho "" 
None.gif
None.gifexit 14 
None.giffi 
None.gifecho $password | grep : >/dev/null 
None.gifif [ "$?" = "0" ]; then 
None.gif
None.gifecho "ERROR: Password contains a : character" 
None.gifecho "" 
None.gifexit 14 
None.gif
None.giffi 
None.gif
None.giffi 
None.gif
None.gifdefhost=`hostname` 
None.gifprintf "Web server hostname (default $defhost): " 
None.gifif [ "$host" = "" ]; then 
None.gif
None.gifread host 
None.gif
None.gifif [ "$host" = "" ]; then 
None.gif
None.gifhost=$defhost 
None.giffi 
None.giffi 
None.gifif [ "$ssl" = "" ]; then 
None.gifssl=0 
None.gif
None.gif$perl -e 
' use  Net :: SSLeay '  >/dev/null 2>/dev/null 
None.gifif [ $? = "0" ]; then 
None.gifprintf "Use SSL (y/n): " 
None.gifread sslyn 
None.gifif [ "$sslyn" = "y" -o "$sslyn" = "Y" ]; then 
None.gifssl=1 
None.giffi 
None.gifelse 
None.gifecho "The Perl SSLeay library is not installed. SSL not available." 
None.gif
None.gifrm -f core 
None.giffi 
None.gif
None.giffi 
None.gif
None.gif# Ask whether to run at boot time 
None.gif
None.gifif [ "$atboot" = "" ]; then 
None.gif
None.gifinitsupp=`grep "^os_support=" $wadir/init/module.info | sed -e 
' s / os_suppor 
None.gift
=// g '  | grep $os_type` 
None.gif
None.gifatboot=0 
None.gifif [ "$initsupp" != "" ]; then 
None.gif
None.gifprintf "Start webmin at boot time (y/n): " 
None.gifread atbootyn 
None.gif
None.gifif [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then 
None.gif
None.gifatboot=1 
None.gif
None.giffi 
None.gifelse 
None.gifecho "webmin does not support being started at boot time on your system." 
None.gif
None.giffi 
None.giffi 
None.gif
None.gifmakeboot=$atboot 
None.gif
None.gif#很无聊啊, 在分析下去dot.gif.. 失败! 选择错误! 
None.gif#太失败拉dot.gifdot.gifdot.gifdot.gifdot.gifdot.gifdot.gifdot.gifdot.gifdot.gifdot.gifdot.gif.不好玩 
None.gif
None.gifif [ "$port" = "" ];then 
None.gifread port 
None.gifif [ "$port" = "" ];then 
None.gifport=8081 
None.giffi 
None.giffi 
None.gifif [ $port -lt 1]; then 
None.gifecho "error message" 
None.gifeixt 11 
None.giffi 
None.gif#接受拥护定义服务端口号, 缺省使用8081 
None.gifif [ $port -gt 65535 ] ;then 
None.gif#error message 
None.gifexit 12 
None.giffi 
None.gif#若用户定义的端口号大于65535 , 则报错退出 
None.gif#用户可使用的端口是从1000 以后还是从1024 以后? 谁告诉我? 
None.gif$perl -e 
' use   Socket socket (FOO ,  PF_INET ,  SOCK_STREAM ,   getprotobyname ( " tcp "  
None.gif)); 
None.gifset 
socket (FOO , SOL_SOCKET , SO_REUSEADDR ,   pack ( " l " , 1 )); 
None.gif
bind (FOO , sockaddr_in( $ARGV [ 0 ] , INADDR_ANY))  ||   exit ( 1 ); exit ( 0 ); '  $p 
None.gifort 
None.gifif [ $? !="0" ]; then 
None.gifecho "error messagedot.gif
None.gifexit 13 
None.giffi 
None.gif#测试端口是否被占用, 方法见perl -e 那行的代码 
None.gifprintf "login name (default admin):" 
None.gifif [ "$loging" = ""] ; then 
None.gifread login 
None.gifif [ "$login" = ""]; then 
None.gifloging="admin" 
None.giffi 
None.giffi 
None.gif#接受用户输入的管理员名称,缺省使用admin 
None.gifecho $login | grep : >/dev/null 
None.gifif [ "$?" = "0" ] ; then 
None.gifecho error mesage.. 
None.gifexit 14 
None.giffi 
None.gif# 检测用户名称是否合法, 这里可以稍加改进,不用动不动就退出安装. 
None.gifpirntf " loging passwd" 
None.gifif [ "$password" = "" -a "$crypt" = "" ]; then 
None.gifstty -echo 
None.gifread password 
None.gifstty echo 
None.gifprintf "\n" 
None.gifprintf "password agani:" 
None.gifstty -echo 
None.gifread password2 
None.gifstty echo 
None.gifprintf "\n" 
None.gifif [ "$password" != "$pasword2" ] ;then 
None.gifecho "Error message" 
None.gifexit 14 
None.giffi 
None.giffi 
None.gif#检查密码,并控制屏显 
None.gifdefhost=
' hostname '  
None.gifprintf "web server hostname (default $defhost):" 
None.gifif [ "$host" = ""]; then 
None.gifread host 
None.gifif [ "$host" = "" ]; then 
None.gifhost=$defhost 
None.giffi 
None.giffi 
None.gif# 设置主机名称,没有则接受用户输入 
None.gifif [ "$ssl" = ""]; then 
None.gifssl = 0 
None.gif$perl -e 
' use  Net :: SSLeay ' >/dev/null 2>/dev/null 
None.gifif [ $? = "0" ] ; then 
None.gifprintf "Use SSL (y/n):" 
None.gifread sslyn 
None.gifif [ "$sslyn" = "y" -o "$sslyn" = "Y" ] ; then 
None.gifssl=1 
None.giffi 
None.gifelse 
None.gifecho "asdfjalksdjfjcjvknxdot.gif." 
None.gifrm -f core 
None.giffi 
None.giffi 
None.gif#检查是否正确安装支持 ssl 模块, 否则给出提示信息 
None.gifif [ "$atboot" = "" ];then 
None.gifinitsupp=
' grep   " ^os_support= "   $wadir / init / module . info  |  sed  - ' s/os_suppo 
None.gifrt=//g
'   | grep   $os_type '  
None.gifatboot=0 
None.gifif [ "$initsupp" != ""];then 
None.gifprintf "Start webmin at boot time (y/n):" 
None.gifread atbootyn 
None.gifif [ "$atbootyn" = "y" -o "$atbootyn" = "Y"]; then 
None.gifatboot=1 
None.giffi 
None.gifelse 
None.gifecho dot.gifdot.gifdot.gifdot.gifdot.gif
None.giffi 
None.giffi 
None.gif#检测模块安装文件/init/module.info中查找os_support 项所支持的 
None.gif#os_type中是否有当前的os_type,有则提示用户选择是否在系统启动时 
None.gif#启动webmin 
None.gif
None.gifecho $perl > $config_dir/perl-path 
None.gifecho $var_dir > $config_dir/var-path 
None.gifecho "******************************************" 
None.gif
None.gifecho "Creating web server config files.." 
None.gif
None.gifcfile=$config_dir/miniserv.conf 
None.gif
None.gifecho "port=$port" >> $cfile 
None.gif
None.gifecho "root=$wadir" >> $cfile 
None.gif
None.gifecho "host=$host" >> $cfile 
None.gif
None.gifecho "mimetypes=$wadir/mime.types" >> $cfile 
None.gif
None.gifecho "addtype_cgi=internal/cgi" >> $cfile 
None.gif
None.gifecho "realm=LNMS Server" >> $cfile 
None.gif
None.gifecho "logfile=$var_dir/miniserv.log" >> $cfile 
None.gif
None.gifecho "pidfile=$var_dir/miniserv.pid" >> $cfile 
None.gif
None.gifecho "logtime=168" >> $cfile 
None.gif
None.gifecho "ppath=$ppath" >> $cfile 
None.gif
None.gifecho "ssl=$ssl" >> $cfile 
None.gif
None.gifecho "env_LNMS_CONFIG=$config_dir" >> $cfile 
None.gif
None.gifecho "env_LNMS_VAR=$var_dir" >> $cfile 
None.gif
None.gifecho "atboot=$atboot" >> $cfile 
None.gif
None.gifecho "logout=$config_dir/logout-flag" >> $cfile 
None.gif
None.gifecho "listen=10000" >> $cfile 
None.gif
None.gifecho "denyfile=\\.pl\$" >> $cfile 
None.gif
None.gifif [ "$allow" != "" ]; then 
None.gif
None.gifecho "allow=$allow" >> $cfile 
None.gif
None.giffi 
None.gif
None.gifif [ "$session" != "" ]; then 
None.gif
None.gifecho "session=$session" >> $cfile 
None.gif
None.gifelse 
None.gif
None.gifecho "session=1" >> $cfile 
None.gif
None.giffi 
None.gif#创建/etc/webmin(配置文件目录)下的miniserv.conf 
None.gif#前面搜集的一些变量在此被写入文件 
None.gif
None.gifufile=$config_dir/miniserv.users 
None.gif
None.gifif [ "$crypt" != "" ]; then 
None.gif
None.gifecho "$login:$crypt:0" > $ufile 
None.gifelse 
None.gif
None.gif$perl -e 
' print   " $ARGV[0]: " , crypt ( $ARGV [ 1 ] ,   " XX " ) , " :0\n "'  "$login" "$passwo 
None.gifrd" > $ufile 
None.gif
None.giffi 
None.gif
None.gifchmod 600 $ufile 
None.gif
None.gifecho "userfile=$ufile" >> $cfile 
None.gif
None.gif#创建用户加密文件,并更改其权限 
None.gifkfile=$config_dir/miniserv.pem 
None.gif
None.gifcp $wadir/miniserv.pem $kfile 
None.gif
None.gifchmod 600 $kfile 
None.gif
None.gif#拷贝安装目录下的miniserv必须的模块文件到/etc/webmin 目录 
None.gif#并设置权限 
None.gifecho "keyfile=$config_dir/miniserv.pem" >> $cfile 
None.gif
None.gif#追加miniserv 模块文件信息至 miniserv.conf 文件 
None.gifchmod 600 $cfile 
None.gif
None.gifecho "..done" 
None.gif
None.gifecho "" 
None.gif
None.gifecho "Creating access control file.." 
None.gif
None.gifafile=$config_dir/webmin.acl 
None.gif
None.gifrm -f $afile 
None.gif
None.gif#清空已存在的webmin acl 文件,不管有没有,删下看! 
None.gifecho "$login: $allmods" >> $afile 
None.gif
None.gifchmod 600 $afile 
None.gif
None.gifecho "..done" 
None.gif
None.gifecho "" 
None.gif#将现有的模块注册,并重新创建webmin.acl 文件 
None.gif
None.gif还有一点dot.gif.. 
None.gif
None.gif#有问题啊这里,谁给我讲讲 
None.gifif [ "$noperlpath" = "" ]; then 
None.gifecho "Inserting path to perl into scripts.." 
None.gif(find $wadir -name 
' *. cgi '  -print;find $wadir -name  ' *. pl '  -print) 
None.gif| $perl $wadir/perlpath.pl $perl - 
None.gifecho "..done" 
None.gifecho "" 
None.giffi 
None.gif# 有问题 :perl perlpath.pl perl - dot.gif 这里在做什么?! 
None.gif#创建/etc/webmin/start & stop 脚本。。。略 
None.gifif [ -r /etc/system.cnf ] ; then 
None.gifsource /etc/system.cnf 
None.gifif [ "$CONF_LST_LANG" = "us" ];then 
None.gifCONF_LST_LANG=en 
None.gifelif [ "$CONF_LST_LANG" = "uk" ]; then 
None.gifCONF_LST_LANG=en 
None.giffi 
None.gifgrep "lang=$CONF_LST_LANG," $wadir/lang_list.txt >/dev/null 2>&1 
None.gifif [ "$?" = 0 ]; then 
None.gifecho "lang=$CONF_LST_LANG" >> $config_dir/config 
None.giffi 
None.giffi 
None.gif#检查系统培植文件/etc/system.cnf中的CONF_LST_LANG 
None.gif#设置语言相关得选项 
None.gif
None.gifecho $ver > $config_dir/version 
None.gifecho "..done" 
None.gifif [ "$makeboot" = "1" ] ;then 
None.gif.. 
None.gif(cd $wadir/init; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir 
None.gif$wadir/init/atboot.pl) 
None.gif.. 
None.giffi 
None.gif# 根据安装时的启动选项设置相关文件,参数 
None.gif# 注意最后运行的 atboot.pl 再作分析 
None.gifif [ "$nouninstall" = "" ]; then 
None.gif.. 
None.gifcat >$config_dir/uninstall.sh <<EOF 
None.gif#!/bin/sh 
None.gifprintf " Are you sure you want to unistall Webmin? (Y/N):" 
None.gifread answer 
None.gifprintf "\n" 
None.gifif [ "\$answer" = "y" ]; then 
None.gif$config_dir/stop 
None.gifif [ "$atboot" = "1" ]; then 
None.gif(cd $wadir/init ; WEBIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir $wadir/init/ 
None.gifdelboot.pl) 
None.giffi 
None.gifecho "Deleting $wadir.." 
None.gifrm -rf $wadir 
None.gifecho "Deleting $config_dir ." 
None.gifrm -rf $config_dir 
None.gifecho "..Done" 
None.giffi 
None.gifEOF 
None.gifchmod +x $config_dir/uninstall.sh 
None.gifecho "..done" 
None.giffi 
None.gif# 创建卸载脚本, 很easy 给点提示,让后把相关得目录删掉即可 
None.gif# 注意$wadir/init/delboot.pl 并注意与adboot.pl 对照 
None.gif
None.gifecho "Changing ownership and permissions .." 
None.gifchown -R root:bin $config_dir 
None.gifchmod -R og-rw $config_dir 
None.gifchmod 755 $config_dir/sendmail/config >/dev/null 2>&1 
None.gifchmod 755 $config_dir/sendmail/autoreply.pl >/dev/null 2>&1 
None.gif#改变配置模块文件属主及访问权限 
None.gif#为什么对sendmail单独处理? 我还不太清楚 
None.gifif [ "$nochown" = "" ]; then 
None.gif
None.gifchown -R root:bin $wadir 
None.gif
None.gif#chmod -R og-rwx $wadir 
None.gif
None.gifif [ $var_dir != "/var" ]; then 
None.gifchown -R root:bin $var_dir 
None.gifchmod -R og-rwx $var_dir 
None.gif
None.giffi 
None.giffi 
None.gifecho "..done" 
None.gifecho "" 
None.gif#改变安装目录(安装完后即执行目录)的属主 
None.gif#处理$var_dir 的属主及执行权限 比较周到 
None.gifif [ "$nostart" = "" ]; then 
None.gif
None.gifecho "Attempting to start Webmin mini web server.." 
None.gif
None.gif$config_dir/start 
None.gif
None.gifif [ $? != "0" ]; then 
None.gifecho "ERROR: Failed to start web server!" 
None.gifecho "" 
None.gifexit 14 
None.gif
None.giffi 
None.gif# 试图启动webmin 的 mini server 
None.gif# 若失败则退出 
None.gif
None.gifecho "..done" 
None.gif
None.gifecho "" 
None.gif
None.gifecho "***********************************" 
None.gif
None.gifecho "Webmin has been installed and started successfully. Use your web" 
None.gifecho "browser to go to" 
None.gif
None.gifecho "" 
None.gif
None.gif#启动成功给出响应的提示信息 
None.gifif [ "$ssl" = "1" ]; then 
None.gifecho " https://$host:$port/" 
None.gif
None.gifelse 
None.gif
None.gifecho " http://$host:$port/" 
None.gif
None.giffi 
None.gif
None.gifecho "" 
None.gif
None.gifecho "and login with the name and password you entered previously." 
None.gif
None.gifecho "" 
None.gif
None.gifif [ "$ssl" = "1" ]; then 
None.gifecho "Because Webmin uses SSL for encryption only, the certificate" 
None.gif
None.gifecho "it uses is not signed by one of the recognized CAs such as" 
None.gif
None.gifecho "Verisign. When you first connect to the Webmin server, your" 
None.gif
None.gifecho "browser will ask you if you want to accept the certificate" 
None.gif
None.gifecho "presented, as it does not recognize the CA. Say yes." 
None.gif
None.gifecho "" 
None.giffi 
None.gif#若ssl 有效,则给出启动客户端的方式:https://dot.gif:prot 
None.giffi 
None.gif# over 本次分析排除了,upgrade 操作的代码分析dot.gif 不过我认为 
None.gif# 主要部分搞定的话,足以,省得看着那么多,不爽! :) 
目录
相关文章
|
5月前
|
JavaScript Shell 开发工具
使用 npm config set script-shell 实现跨平台的脚本执行需求
使用 npm config set script-shell 实现跨平台的脚本执行需求
48 1
|
5月前
|
应用服务中间件 Shell 网络安全
用shell脚本获取Nginx日志
用shell脚本获取Nginx日志
59 1
|
5月前
|
Shell 开发工具
shell脚本中调用vim处理文档
shell脚本中调用vim处理文档
|
5月前
|
Linux Shell
suse 12 sp3 利用shell脚本离线编译安装ansible
suse 12 sp3 利用shell脚本离线编译安装ansible
49 0
|
8月前
|
Shell Linux
解决脚本文件无法执行conda命令的问题:CommandNotFoundError: Your shell has not been properly configured to use
使用Linux系统时,有时候希望利用一个脚本执行多条命令来节省时间,其中如果安装有anaconda,需要切换环境或者关闭conda环境,按道理说,在终端里可以通过命令
449 0
构建freeswitch, make cd-moh-install提示文件错误
构建freeswitch, make cd-moh-install提示文件错误
91 0
|
应用服务中间件 Shell 网络安全
自动配置nginx 证书 shell sh 脚本
自动部署ssl nginx 证书
263 0