1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../webmin/stone_mod_webmin.sh
5 # Copyright (C) 2004 - 2007 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 # [MAIN] 80 webmin Webmin Configuration
19 USERFILE
=/etc
/opt
/webmin
/miniserv.users
20 CONFFILE
=/etc
/opt
/webmin
/miniserv.conf
21 ACLFILE
=/etc
/opt
/webmin
/webmin.acl
27 while [ "$PASSWORD" != "$PASSWORD2" ] ; do
28 gui_input
"Enter $LOGIN password" "" PASSWORD
;
29 gui_input
"Re-Enter $LOGIN password" "" PASSWORD2
;
30 if [ "$PASSWORD" != "$PASSWORD2" ] ; then
31 gui_message
"Passwords are different: no change!"
34 if [ "$2" = 1 ] ; then
35 gui_message
"Changeing $LOGIN password."
37 sed "/^$LOGIN:.*/ s/^$LOGIN:[^:]*:/$LOGIN:`perl -e 'print crypt($ARGV[0], "XX
");' "$PASSWORD"`:/ ;" < $USERFILE > $tmp
38 cat $tmp > $USERFILE ; rm -f $tmp
40 gui_message
"Setting $LOGIN password."
41 perl
-e 'print "$ARGV[0]:",crypt($ARGV[1], "XX"),":0::\n"' "$LOGIN" "$PASSWORD" >> $USERFILE
48 ALLMODS
=`echo $WEBMINDIR/*/module.info | sed -e "s,$WEBMINDIR/,,g ; s,/module.info,,g"`
49 if [ "$2" = 1 ] ; then
50 gui_message
"Resetting $LOGIN acls to default."
52 sed "/^$LOGIN:.*/ s/:.*/: $ALLMODS/ ;" < $ACLFILE > $tmp
53 cat $tmp > $ACLFILE ; rm -f $tmp
55 gui_message
"Setting $LOGIN acls to default."
56 echo "$LOGIN: $ALLMODS" >> $ACLFILE
61 gui_input
"Enter user login" "admin" LOGIN
;
62 if [ "`grep \"^$LOGIN:\" $USERFILE`" = "" ] ; then
63 gui_message
"New user $LOGIN !"
67 gui_message
"Existing user $LOGIN !"
68 if gui_yesno
"Change $LOGIN password?" ; then
71 if gui_yesno
"Reset $LOGIN acls?" ; then
78 gui_edit
"Edit file $1" "$1"
84 cmd
="gui_menu webmin 'Webmin Configuration - Select an item to'"
86 cmd
="$cmd 'Add/(Re-)Set user password and acls' 'set_user'"
88 cmd
="$cmd '' '' 'Configure runlevels for webmin service'"
89 cmd
="$cmd '$STONE runlevel edit_srv webmin'"
90 cmd
="$cmd '(Re-)Start webmin init script'"
91 cmd
="$cmd '$STONE runlevel restart webmin'"
94 cmd
="$cmd 'View/Edit $CONFFILE file' 'edit $CONFFILE'"