Jump to content
Froxlor Forum
  • 0

[Script inside] Automatic installation of froxlor on Debian Squeeze


marten

Question

Hello,

 

I created a script for an automatic installation and configuration of froxlor.

 

More info are within this Script.

 

Maybe someone has an idea to solve some problems:

 

- auto-yes to dialog-questions for some dialogs are displayd during install mysql, postfix etc.

 

Any ideas, featuresrequests and questions are welcome.

 

have fun :)

 

//edit

bug-fix: add line replace /etc/postfix/mysql-virtual_alias_maps.cf \<SQL_HOST\> 127.0.0.1

 

#!/bin/bash

# Scriptname: froxlor.sh
# Author: Marten Michaelsen 
# Version/Date: 1.0 / 04.03.2011  
# Organisation: Kagerbauer Software (www.kagerbauer.net)
# E-Mail: support@deinprovider.de 

# Install und UpdateScript for Froxlor 
# optimized for Debian Squeeze with Apache2, Postfix / Courier POP3/IMAP, Proftpd

# This script is licensed under GNU GPL version 2.0 or above

# use it with:

####.########.########...#######..##.....##.##........#######..########.
####.##.......##.....##.##.....##..##...##..##.......##.....##.##.....##
####.##.......##.....##.##.....##...##.##...##.......##.....##.##.....##
####.######...########..##.....##....###....##.......##.....##.########.
####.##.......##...##...##.....##...##.##...##.......##.....##.##...##..
####.##.......##....##..##.....##..##...##..##.......##.....##.##....##.
####.##.......##.....##..#######..##.....##.########..#######..##.....##

# Website: http://www.froxlor.de

###################

#  !!!! This Script ist for a blank installation of Debian Squeeze !!!!

###################


###################

# Variables

###################

# edit for changes 
pmaver=3.3.7						# phpmyadmin-version
mustversion="0.9.18-1" 				# Script is for this froxlor-Version. Stops if not equal

# Enter servername required after scriptstart
# Form:  hostname.domain.tld

## Password-function

function randpw () {
echo $(( ($RANDOM + $RANDOM) * $RANDOM )) | md5sum | cut -c1-8
}

# generate Passwords

mpw=$(randpw) 						# mysql-password
smpw=$(randpw) 						# mysql-password froxlor
hpw=$(randpw)						# htaccess-password
apw=$(randpw)						# Froxlor-Admin-pw

# parse ip from ifconfig
ip=$(ifconfig | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | egrep -v '255|(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')

# phpmyadmin-url
pmaurl=http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/$pmaver/phpMyAdmin-$pmaver-all-languages.tar.gz?use_mirror=kent

# Path for Froxlor config-files
cpath=/var/www/froxlor/templates/misc/configfiles/debian_lenny

# at debian installation, it rqeuires a normal user-account. name it "nouser". 
# this script will delete this user again.
userdel nouser



###################

# Function

###################


# syntax:  replace FILE SEARCHSTRING REPLACEWITH
function replace  {

file=$1
search=$2
replace=$3 

cp $file $file.old
sed "s/$search/$replace/g" $file.old > $file
 rm $file.old
}


###################

# Start here ... 

###################

#### Menu
echo "FROXLOR - Installation- and update-script"
echo "-----------------------------------------"
echo ""
echo "Hint: if mysql-password required: leave emty"
echo "Hint: press simply enter on every dialog"
echo "Info: If a user named 'nouser' is existing, this user will be deleted "
echo
echo "Install or Update Froxlor?"
echo "1 Install"
echo "2 Update"
echo ""
echo "Enter: "
read o

# if upgrade do
if [ $o -gt 2 ]; then 
echo "wrong input"
exit 0	
fi

# if install do
if [ $o -eq 1 ]; then

  echo "Enter servername (e.g. hostname.domain.tld) "
  read servername
fi


###################

# Update and Upgrade

###################

# if upgrade do
if [ $o -eq 2 ]; then
apt-get update && apt-get upgrade 
fi



# if install do
if [ $o -eq 1 ]; then


### add froxlor-key

apt-key adv --keyserver gpg-keyserver.de --recv-keys 4F9E9BBC


   # Configure Timezone   
dpkg-reconfigure tzdata

# add froxlor to sources.list
echo -ne  "\ndeb http://debian.froxlor.org/ squeeze main\ndeb-src http://debian.froxlor.org squeeze main" >> /etc/apt/sources.list

apt-get update && apt-get upgrade 

wantversion=$(apt-cache show froxlor | grep "Version: " |sed -r "s/Version: ([0-9\.])/\1/")

if [ "$mustversion" != "$wantversion" ]; then
echo "Script required Froxlor-Version $musversion. But you try to install Froxlor $wantversion . Check Script. Abort."
exit 1
else
echo "Versioncheck OK "
fi

###################

# Install Software

###################



export ctl=0 && apt-get install --force-yes -y froxlor ntpdate postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql courier-pop courier-imap courier-authlib-mysql proftpd-basic proftpd-mod-mysql awstats courier-pop courier-imap && export ctl=1
if [ $ctl -ne 1 ]; then 
exit 1

fi

apt-get remove -y --force-yes --purge exim4-base exim4-config 
apt-get -y autoremove 


###################

# Froxlor ...

###################


# fill installationform and send data via wget 	

wgetpost="\"&mysql_host=127.0.0.1&\
mysql_database=froxlor&\
mysql_unpriv_user=froxlor&\
mysql_unpriv_pass=$smpw&\
mysql_root_user=root&\
mysql_root_pass=$mpw&\
admin_user=admin&\
admin_pass1=$apw&\
admin_pass2=$apw&\
servername=$servername&\
serverip=$ip&\
webserver=apache2&\
httpuser=www-data&\
httpgroup=www-data&\
check=1&\
language=english&\
installstep=1&\
submitbutton=Next\
\"
"
    wget -q -O /dev/null --post-data $wgetpost http://$ip/froxlor/install/install.php?check=1

fi

# if upgrade do
# extract mysql unpriviliged password 
if [ $o -eq 2 ]; then
export P=$(cat /var/www/froxlor/lib/userdata.inc.php | grep "sql\['password'" ) && [[ $P =~ \=\'([0-9a-zA-Z]+) ]] && export smpw=${BASH_REMATCH[1]}
fi	

###################

# Configure Services

###################

### configure ntpdate

echo "0 1 * * * 	root 	ntpdate ntp1.ptb.de && hwclock --systohc" >> /etc/crontab
ntpdate ntp1.ptb.de && hwclock --systohc


### prepare for Apache 

mkdir -p /var/customers/webs/
mkdir -p /var/customers/logs/
mkdir -p /var/customers/tmp
chmod 1777 /var/customers/tmp
a2dismod userdir
rm /var/www/index.html


### prepare MTA Postfix

cp $cpath/postfix_courier/etc_postfix_main.cf /etc/postfix/main.cf 
cp $cpath/postfix_courier/etc_postfix_mysql-virtual_alias_maps.cf /etc/postfix/mysql-virtual_alias_maps.cf
cp $cpath/postfix_courier/etc_postfix_mysql-virtual_mailbox_domains.cf /etc/postfix/mysql-virtual_mailbox_domains.cf
cp $cpath/postfix_courier/etc_postfix_mysql-virtual_mailbox_maps.cf /etc/postfix/mysql-virtual_mailbox_maps.cf
cp $cpath/postfix_courier/etc_postfix_sasl_smtpd.conf /etc/postfix/sasl/smtpd.conf
cp $cpath/postfix_courier/etc_postfix_mysql-virtual_sender_permissions.cf /etc/postfix/mysql-virtual_sender_permissions.cf

mkdir -p /var/spool/postfix/etc/pam.d
mkdir -p /var/spool/postfix/var/run/mysqld
groupadd -g 2000 vmail
useradd -u 2000 -g vmail vmail
mkdir -p /var/customers/mail/
chown -R vmail:vmail /var/customers/mail/
chown root:root /etc/postfix/main.cf
chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf
chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf
chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf
chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf
chown root:root /etc/postfix/sasl/smtpd.conf
chmod 0644 /etc/postfix/main.cf
chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf
chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf
chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf
chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf
chmod 0600 /etc/postfix/sasl/smtpd.conf


### setup MTA configfiles

replace /etc/postfix/mysql-virtual_alias_maps.cf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/postfix/mysql-virtual_alias_maps.cf \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/postfix/mysql-virtual_alias_maps.cf \<SQL_DB\> froxlor
replace /etc/postfix/mysql-virtual_alias_maps.cf \<SQL_HOST\> 127.0.0.1

replace /etc/postfix/mysql-virtual_mailbox_domains.cf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/postfix/mysql-virtual_mailbox_domains.cf \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/postfix/mysql-virtual_mailbox_domains.cf \<SQL_DB\> froxlor
replace /etc/postfix/mysql-virtual_mailbox_domains.cf \<SQL_HOST\> 127.0.0.1

replace /etc/postfix/mysql-virtual_sender_permissions.cf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/postfix/mysql-virtual_sender_permissions.cf \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/postfix/mysql-virtual_sender_permissions.cf \<SQL_DB\> froxlor
replace /etc/postfix/mysql-virtual_sender_permissions.cf \<SQL_HOST\> 127.0.0.1

replace /etc/postfix/mysql-virtual_mailbox_maps.cf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/postfix/mysql-virtual_mailbox_maps.cf \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/postfix/mysql-virtual_mailbox_maps.cf \<SQL_DB\> froxlor
replace /etc/postfix/mysql-virtual_mailbox_maps.cf \<SQL_HOST\> 127.0.0.1

replace /etc/postfix/sasl/smtpd.conf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/postfix/sasl/smtpd.conf \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/postfix/sasl/smtpd.conf \<SQL_DB\> froxlor
replace /etc/postfix/sasl/smtpd.conf \<SQL_HOST\> 127.0.0.1

replace /etc/postfix/main.cf \<VIRTUAL_MAILBOX_BASE\> \\/var\\/customers\\/mail\\/

replace /etc/postfix/main.cf \<SERVERNAME\> $servername
replace /etc/postfix/main.cf \<VIRTUAL_UID_MAPS\> 2000
replace /etc/postfix/main.cf \<VIRTUAL_GID_MAPS\> 2000

echo "virtual_mailbox_limit = 0" >> /etc/postfix/main.cf

### setup courier configfiles

cp $cpath/courier/etc_courier_authdaemonrc /etc/courier/authdaemonrc
cp $cpath/courier/etc_courier_authmysqlrc /etc/courier/authmysqlrc

replace /etc/courier/authmysqlrc \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/courier/authmysqlrc \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/courier/authmysqlrc \<SQL_DB\> froxlor
replace /etc/courier/authmysqlrc \<SQL_HOST\> 127.0.0.1

### setup proftpd configfiles

cp $cpath/proftpd/etc_proftpd_sql.conf /etc/proftpd/sql.conf
replace /etc/proftpd/sql.conf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw
replace /etc/proftpd/sql.conf \<SQL_UNPRIVILEGED_USER\> froxlor
replace /etc/proftpd/sql.conf \<SQL_DB\> froxlor
replace /etc/proftpd/sql.conf \<SQL_HOST\> 127.0.0.1

cp $cpath/proftpd/etc_proftpd_modules.conf /etc/proftpd/modules.conf


cp $cpath/proftpd/etc_proftpd_proftpd.conf /etc/proftpd/proftpd.conf
replace /etc/proftpd/proftpd.conf \<SERVERNAME\> $servername

cp $cpath/cron/etc_cron.d_froxlor /etc/cron.d/froxlor



###################

# configure awstats

###################

cp /usr/share/awstats/tools/awstats_buildstaticpages.pl /usr/bin/
mv /etc/awstats/awstats.conf /etc/awstats/awstats.model.conf
sed -i.bak 's/^DirData/# DirData/' /etc/awstats/awstats.model.conf



###################

# extra 

###################


if [ $o -eq 1 ]; then

# configure default vhost 	
echo "
NameVirtualHost $ip:80
<VirtualHost $ip:80>
 DocumentRoot "/var/www"
</VirtualHost>
" >> /etc/apache2/httpd.conf

# activate mod_rewrite
a2enmod rewrite

# htaccess passwordprotection
htpasswd -cb /var/www/.htpasswd admin $hpw

echo -e "require valid-user \n\
AuthName "admin" \n\
Authtype Basic \n\
AuthUserFile /var/www/.htpasswd \n" > /var/www/.htaccess


# configure logrotate
cat > /etc/logrotate.d/froxlor << EOF 
/var/customers/logs/*.log {
daily
missingok
rotate 52
compress
delaycompress
    notifempty
        create 640 root adm
        sharedscripts
        postrotate
           if [ -f /var/run/apache2.pid ]; then \\
             if [ -x /usr/sbin/invoke-rc.d ]; then \\
                invoke-rc.d apache2 reload > /dev/null; \\
             else \\
                /etc/init.d/apache2 reload > /dev/null; \\
             fi; \\
           fi;
        endscript
}
EOF

echo "Incremental     yes" >> /etc/webalizer/webalizer.conf
echo "IncrementalName        webalizer.current" >> /etc/webalizer/webalizer.conf

 /etc/init.d/apache2 reload
fi


###################

# Restart Services 

###################


/etc/init.d/postfix restart
newaliases
/etc/init.d/courier-authdaemon restart
/etc/init.d/courier-pop restart
/etc/init.d/proftpd restart
/etc/init.d/cron restart
/etc/init.d/apache2 restart


###################

# PHPMyAdmin installation

###################

# change to 
cd /var/www/ 

# if upgrade do
# delete old phpmyadmin
if [ $o -eq 2 ]; then
rm -r phpMyAdmin
fi


# in every case do
wget $pmaurl -O phpMyAdmin-$pmaver-all-languages.tar.gz
tar xvzf phpMyAdmin-$pmaver-all-languages.tar.gz
rm phpMyAdmin-$pmaver-all-languages.tar.gz
mv phpMyAdmin-$pmaver-all-languages phpMyAdmin
cd phpMyAdmin
rm README
mv config.sample.inc.php config.inc.php 

rmd5=$(echo $(( ($RANDOM + $RANDOM) * $RANDOM )) | md5sum | cut -c1-32)

replace /var/www/phpMyAdmin/config.inc.php  "_secret'] = ''" "_secret'] = '$rmd5'"
replace /var/www/phpMyAdmin/config.inc.php  "localhost" "127.0.0.1"

# if install do 
# display Usernames and Passwords
if [ $o -eq 1 ]; then
echo "User and Password for .htaccess"
echo "Username: admin"
echo "Password: $hpw"
echo "---------------"
echo "URL,User and Password Froxlor:"
echo "URL: http://$servername/"
echo "Username: admin"
echo "Password: $apw"
echo "---------------"
echo "MySQL-user froxlor:"
echo "Password: $smpw"
echo "---------------"
echo "MySQL-user root:"
echo "Password: $mpw"
fi 

echo "Upgrade or Installation done"

exit 0

froxlor.sh.txt

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Thanks for your script. I went through it to help me understand what froxlor needs.

 

I updated a couple things and added some comments. For instance, I did not want to run ntpdate and I already have a replace utility provided by mysql.

 

Is this version any use to you?

martens-froxlor-script-2.txt

 

It has UNIX line endings, not DOS, so it will look a mess in notepad.

Link to comment
Share on other sites

Hi, everyone.

 

I've been working on an automated installation and configuration

of froxlor for a few weeks now. It should be fully functional by

Monday. I will hopefully be able to post it then.

I borrowed heavily from marten (1st Post) for the wget thingy

that does the initial "install" and for the creation of randomized

passwords. *thank you very much*

 

@marten

if your problems with questions during the install still persist

look at debconf-get-selections and debconf-set-selections.

these are very useful for creating/reading "answer files" akin

to preseeding.

One other thing:

You generate a random password for MySQL root that you use in

the wget part of your script for the initial setup. since you did not

tell MySQL about that, this should essentially break your script.

Planetlarg fixes this by just not using it, from what i've seen.

 

I simply injected said password into the answer-file and voila,

it works.

 

btw. i'm setting it up with apache, bind9, exim, dovecot and proftpd

 

More info will follow once i am done.

 

greetings

/moddie

Link to comment
Share on other sites

As promised my Script:

it is downloaded and run from /etc/rc.local of a completely

preseeded debian 6.0 install. the selects files set the

preferences for all the programs so no debconf questions

will need to be answered. The only input reqired is an

IP address because the IP configuration for the machines

needs to be static.

 

The only non standard config file is dovecot.conf where the

Postfix auth socket is commented out for dovecot to work.

like so:

   socket listen {
   	# Postfix uses the client socket for SMTP Auth
	#client {
	#  #Assuming the default Postfix $queue_directory setting
	#path = /var/spool/postfix/private/auth
	#mode = 0660
	#  #Assuming the default Postfix user and group
	#user = postfix
	#group = postfix
	#}
       # Note that we're setting a master socket. SMTP AUTH for Postfix and Exim uses client sockets.
       master {
		path = /var/run/dovecot/auth-master
		mode = 0660
		user = vmail
		group = vmail
  }

   }
}

 

all other configs are not the ones stored in froxlors templates

but they are pretty much the same, only "mysqlpassword" is the

placeholder for the unprivileged MySQL Password.

 

#!/bin/bash
########
echo starting postinst...
########
########################################################################################################################
########################################################################################################################
## Password-function

function randpw () {
echo $(( ($RANDOM + $RANDOM) * $RANDOM )) | md5sum | cut -c1-8
}


function replace  {

file=$1
search=$2
replace=$3 

cp $file $file.old
sed "s/$search/$replace/g" $file.old > $file
 rm $file.old
}
#Usage example for replace
#replace /etc/postfix/mysql-virtual_alias_maps.cf \<SQL_UNPRIVILEGED_PASSWORD\> $smpw

# generate Passwords

mpw=$(randpw)                                           # mysql-password
smpw=$(randpw)                                          # mysql-password froxlor
hpw=$(randpw)                                           # htaccess-password
apw=$(randpw)                                           # Froxlor-Admin-pw
fqdn=`hostname --fqdn`


echo "Please enter the IP address for the external interface"
echo "Be certain that you entered it correctly before poceeding"
echo -n :
read outip
########################################################################################################################
########################################################################################################################
########################################################################################################################
echo "getting key for froxlor apt-source..."
gpg --keyserver gpg-keyserver.de --recv-keys 4F9E9BBC
gpg --export 4F9E9BBC|apt-key add -
echo deb http://debian.froxlor.org/ squeeze main >> /etc/apt/sources.list
apt-get update
########
wget http://10.99.99.1/froxlor-install/froxlorselects
replace froxlorselects msqlrpw $mpw 
debconf-set-selections froxlorselects
apt-get -y install froxlor
########
wget http://10.99.99.1/froxlor-install/eximselects
replace eximselects debian.in.nessus.at $fqdn
debconf-set-selections eximselects
########
wget http://10.99.99.1/froxlor-install.tar.gz
tar xzf froxlor-install.tar.gz
########################################################################################################################
#apache2
########################################################################################################################
echo apache2...
#sleep 10
mkdir -p /var/customers/webs/
mkdir -p /var/customers/logs/
mkdir -p /var/customers/tmp
chmod 1777 /var/customers/tmp
a2dismod userdir

/etc/init.d/apache2 restart
echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#bind9
########################################################################################################################
echo bind9...
#sleep 10

apt-get -y install bind9
echo "include \"/etc/bind/froxlor_bind.conf\";" >> /etc/bind/named.conf
touch /etc/bind/froxlor_bind.conf
chown root:bind /etc/bind/froxlor_bind.conf
chmod 0644 /etc/bind/froxlor_bind.conf

/etc/init.d/bind9 restart

echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#exim4
########################################################################################################################
echo exim4...
#sleep 10
echo configuring exim4...

#apt-get -y install exim4-base exim4-config

#apt-get -y install exim4-daemon-heavy

############COPY##CONFIG##FILES##########################################
cp -Rv froxlor-install/etc/exim4 /etc/

chmod o-rx /var/lib/exim4
chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options
replace /etc/exim4/conf.d/main/10_froxlor-config_options mysqlpassword $smpw
/etc/init.d/exim4 restart

echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#dovecot
########################################################################################################################
echo dovecot...
#sleep 10
###########This#section#is#needed#only#if#4.postfix.sh#is#not#used#######
groupadd -g 2000 vmail
useradd -u 2000 -g vmail vmail

mkdir -p /var/customers/mail/
chown -R vmail:vmail /var/customers/mail/
#########################################################################
apt-get -y install dovecot-imapd dovecot-pop3d

############COPY##CONFIG##FILES##########################################
cp -Rv froxlor-install/etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf

cp -Rv froxlor-install/etc/dovecot/dovecot-sql.conf /etc/dovecot/dovecot-sql.conf
replace /etc/dovecot/dovecot-sql.conf mysqlpassword $smpw
chmod 0640 /etc/dovecot/dovecot-sql.conf

/etc/init.d/dovecot restart

echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#proftpd
########################################################################################################################
echo proftpd...
#sleep 10

apt-get -y install proftpd-basic proftpd-mod-mysql

############COPY##CONFIG##FILES##########################################
cp -Rv froxlor-install/etc/proftpd /etc/
replace /etc/proftpd/sql.conf mysqlpassword $smpw
/etc/init.d/proftpd restart

echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#cron
########################################################################################################################
echo cron...
#sleep 10

touch /etc/cron.d/froxlor

############COPY##CONFIG##FILES##########################################
cp -Rv froxlor-install/etc/cron.d/froxlor /etc/cron.d/froxlor

/etc/init.d/cron restart

echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#awstats
########################################################################################################################
echo awstats...
#sleep 10

apt-get -y install awstats

cp /usr/share/awstats/tools/awstats_buildstaticpages.pl /usr/bin/
mv /etc/awstats/awstats.conf /etc/awstats/awstats.model.conf

sed -i.bak 's/^DirData/# DirData/' /etc/awstats/awstats.model.conf

echo done...
#sleep 10
########################################################################################################################
########################################################################################################################
#froxlor
########################################################################################################################

wgetpost="\"&mysql_host=127.0.0.1&\
mysql_database=froxlor&\
mysql_unpriv_user=froxlor&\
mysql_unpriv_pass=$smpw&\
mysql_root_user=root&\
mysql_root_pass=$mpw&\
admin_user=admin&\
admin_pass1=$apw&\
admin_pass2=$apw&\
servername=$fqdn&\
serverip=$outip&\
webserver=apache2&\
httpuser=www-data&\
httpgroup=www-data&\
check=1&\
language=english&\
installstep=1&\
submitbutton=Next\
\"
"

wget -q -O /dev/null --post-data $wgetpost http://127.0.0.1/froxlor/install/install.php?check=1

# htaccess passwordprotection
# disabled for ease of access
#htpasswd -cb /var/www/.htpasswd admin $hpw
#
#echo -e "require valid-user \n\
#AuthName "admin" \n\
#Authtype Basic \n\
#AuthUserFile /var/www/.htpasswd \n" > /var/www/.htaccess
########################################################################################################################
########################################################################################################################
wget http://10.99.99.1/froxlor-install/rc.local_clean
mv -v ./rc.local_clean /etc/rc.local
chmod -x /etc/rc.local
echo "rc.local cleaned ..."
#echo "all done"
########
chown -R www-data:www-data /var/www
rm *selects
rm -r froxlor-install*
#userdel mod Mortal User disabled by Preseeding
apt-get -y autoremove
/etc/init.d/mysql restart
#/etc/init.d/apache2 restart
#/etc/init.d/cron restart
#/etc/init.d/bind9 restart
#/etc/init.d/dovecot restart
#/etc/init.d/exim4 restart
#/etc/init.d/proftpd restart
echo -e "#Mysql Root PW ... $mpw\t\t#"
echo -e "#Mysql User PW ... $smpw\t\t#"
echo -e "#htaccess   PW ... $hpw\t\t#"
echo -e "#FQDN          ... $fqdn\t\t#"
echo -e "#External   IP ... $outip\t\t#"
echo -e "#Froxlor Admin ... $apw\t\t#"

echo "........................."
echo "....almost.done........"
echo "....please.edit.your....."
echo "./etc/network/interfaces."
echo ".so.the.outside.IF.is...."
echo ".set.to.the.correct......"
echo ".static.IP..............."
echo "........................."
########
rm postinst
exit 0

 

I hope you guys like this.

Please post any questions or comments you might have.

 

greetings

/moddie

Link to comment
Share on other sites

you are right of course and i did realize that they wont be able to use that address.

 

I might not have made it clear enough, that this script is part of an almost fully

automated Installation for new machines, which we set up for our customers. They

are booted from the network with PXE, proceed with an automatic installation and

then before login the script runs.

I thought it was clear this is a machine on my local net.

sorry for the misunderstanding. ;)

 

greetings

/moddie

 

P.S.

someone might want to look at doing a config

template for dovecot without that postfix socket.

i am not sure if what i did wont create problems

with something else. any pointers on that would

be greatly appreciated.

Link to comment
Share on other sites

Thanks all for feedback.

 

 

@moddie666

 

I borrowed heavily from marten (1st Post) for the wget thingy

that does the initial "install" and for the creation of randomized

passwords. *thank you very much*

 

np :)

 

You generate a random password for MySQL root that you use in

the wget part of your script for the initial setup. since you did not

tell MySQL about that, this should essentially break your script.

 

No. Froxlor sets and generate a root-user at the first setup before u logged in.

In this case with the wget-line.

 

I simply injected said password into the answer-file and voila,

it works.

 

... but great idea. thanks :)

 

 

Maybe we could "fuse"our scripts. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...