# Auto install



## maxvoip (Nov 8, 2011)

Hi,
I want to install my FreeBSD server with (pxe, nfs and dhcp) under FreeBSD. All is good, my install.cfg works fine, but I can't load a bash script for my post-install in order to install or configure my server.

I user the following synthax:


```
command=/stand/post-install.sh 
# Autoreboot
shutdown
```

The post-install.sh doesn't work, why? My script works manually.. Any idea?

PS : I use FreeBSD 7.4 and 8.2 RELEASE
Thanks,


----------



## SirDice (Nov 8, 2011)

Bash script or a shell script? You do know bash isn't part of the base OS?


----------



## maxvoip (Nov 8, 2011)

Sorry,

I use shell script for my script.


----------



## SirDice (Nov 9, 2011)

Can you post the script?


----------



## maxvoip (Nov 9, 2011)

Hi,

Here is my install.cfg, if I move the shell script, it's all ok, with no errors, when I activate the shell script with the following command "*command=/stand/post-install.sh*" the installation is aborted..  Thank to have a look in my script.

Thanks,



```
debug=YES
nonInteractive=YES
tryDHCP=YES
noWarn=YES

hostname=mybsd.local
domainname=local.domain

_ftpPath=ftp://ftp.freebsd.org/pub/
netDev=bge0"
mediaSetFTP

# Which installation device to use 
#nfs=192.168.1.1:/usr/autoboot
#netDev=bge0
#mediaSetNFS

dists=base doc manpages info src sbase ssys GENERIC

distSetCustom

disk=ad0
partition=all
bootManager=standard
diskPartitionEditor

# 5Go pour /
ad0s1-1=ufs 10097152 /
# 512 Mo pour le swap
ad0s1-2=swap 1048576 none
diskLabelEditor

installCommit

command=/stand/post-install.sh
```

####Here my shell script


```
#!/bin/sh

# $Wintelcom: src/freebsd/pxe/doc/post,v 1.1 2000/07/14 12:42:05 bright Exp $
# $FreeBSD: doc/en_US.ISO8859-1/articles/pxe/post,v 1.2 2003/11/05 10:59:34 ceri Exp $

echo post-install
echo "Post-installation en cours ........"
set PATH=/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/usr/bin/X11
export PATH

# do timezone
cp /usr/share/zoneinfo/Europe/Paris /etc/localtime
cp /usr/share/examples/pf/pf.conf >> $conf
conf="/etc/rc.conf"

rm $conf
echo 'keymap="fr.iso.acc"' >> $conf
echo 'nfs_server_enable="YES"' >> $conf
echo 'rpcbind_enable="YES"'  >> $conf
echo 'mountd_flags="-r"' >> $conf
echo 'rpc_lockd_enable="YES"' >> $conf
echo 'rpc_statd_enable="YES"' >> $conf
echo 'sendmail_enable="NO"' >> $conf
echo 'sshd_enable="YES"' >> $conf
echo 'linux_enable="YES"' >> $conf
echo 'autoboot_delay="1"' >> /boot/loader.conf
echo 'ahci_load="YES"' >> /boot/loader.conf
echo 'mysecretpasswd' | /usr/sbin/pw usermod -u root -h 0
echo "Post-installation terminee!"
```


----------



## SirDice (Nov 9, 2011)

maxvoip said:
			
		

> ```
> cp /usr/share/examples/pf/pf.conf >> $conf
> ```


$conf isn't defined when the script runs from the installer. The entire command doesn't look correct.


----------

