#!/bin/sh if [ "0" = "1" ]; then # Copy config file to /etc/webmin or /etc/usermin os_type=`grep "^os_type=" /etc/usermin/config | sed -e 's/os_type=//g'` os_version=`grep "^os_version=" /etc/usermin/config | sed -e 's/os_version=//g'` /usr/bin/perl /usr/share/usermin/copyconfig.pl $os_type $os_version /usr/share/usermin /etc/usermin virtual-server-theme # Update the ACL for the root user, or the first user in the ACL grep "^root:" /etc/usermin/webmin.acl >/dev/null if [ "$?" = "0" ]; then user=root else user=`head -1 /etc/usermin/webmin.acl | cut -f 1 -d :` fi mods=`grep $user: /etc/usermin/webmin.acl | cut -f 2 -d :` echo $mods | grep " virtual-server-theme" >/dev/null if [ "$?" != "0" ]; then grep -v ^$user: /etc/usermin/webmin.acl > /tmp/webmin.acl.tmp echo $user: $mods virtual-server-theme > /etc/usermin/webmin.acl cat /tmp/webmin.acl.tmp >> /etc/usermin/webmin.acl rm -f /tmp/webmin.acl.tmp fi fi if [ "" != "" -a "1" = "1" ]; then # Activate this theme grep -v "^preroot=" /etc/usermin/miniserv.conf >/etc/usermin/miniserv.conf.tmp (cat /etc/usermin/miniserv.conf.tmp ; echo preroot=virtual-server-theme) > /etc/usermin/miniserv.conf rm -f /etc/usermin/miniserv.conf.tmp grep -v "^theme=" /etc/usermin/config >/etc/usermin/config.tmp (cat /etc/usermin/config.tmp ; echo theme=virtual-server-theme) > /etc/usermin/config rm -f /etc/usermin/config.tmp (/etc/usermin/stop && /etc/usermin/start) >/dev/null 2>&1 fi rm -f /etc/usermin/module.infos.cache # Run post-install function if [ "usermin" = "webmin" ]; then cd /usr/share/usermin WEBMIN_CONFIG=/etc/usermin WEBMIN_VAR=/var/usermin /usr/share/usermin/run-postinstalls.pl virtual-server-theme fi # Run post-install shell script if [ -r "/usr/share/usermin/virtual-server-theme/postinstall.sh" ]; then cd /usr/share/usermin WEBMIN_CONFIG=/etc/usermin WEBMIN_VAR=/var/usermin /usr/share/usermin/virtual-server-theme/postinstall.sh fi