diff --git a/CHANGELOG.md b/CHANGELOG.md index d423b7a..8344929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +**** Zamba LXC Toolbox main branch **** +- added dhcp support +- fixed hardcoded samba sharename in `zmb-standalone` script +- added support for container id's larger than 999 + **** Zamba LXC Toolbox v0.1 **** - `locales` are now configured noninteractive #21 - timezone is now configured with `pct set` command in `install.sh` #22 @@ -9,4 +14,4 @@ - `mailpiler`: website is now also `default_host`, removed nginx default site, dns entry is still required - changed `mailpiler` version to 1.3.11 - changed `element-web` version to 1.7.25 -- `LXC_AUTHORIZED_KEY` variable now defines an `authorized_keys` file, by default the configuration of you proxmox host will be inherited (`~/.ssh/authorized_keys`) \ No newline at end of file +- `LXC_AUTHORIZED_KEY` variable now defines an `authorized_keys` file, by default the configuration of you proxmox host will be inherited (`~/.ssh/authorized_keys`) diff --git a/install.sh b/install.sh index 09cca52..2f5461e 100644 --- a/install.sh +++ b/install.sh @@ -76,7 +76,7 @@ else fi # Get next free LXC-number -LXC_LST=$( lxc-ls | egrep -o '.{1,5}$' ) +LXC_LST=$( lxc-ls -1 | tail -1 ) LXC_CHK=$((LXC_LST+1)); if [ $LXC_CHK -lt 100 ] || [ -f /etc/pve/qemu-server/$LXC_CHK.conf ]; then @@ -97,7 +97,12 @@ else VLAN="" fi # Reconfigure conatiner -pct set $LXC_NBR -memory $LXC_MEM -swap $LXC_SWAP -hostname $LXC_HOSTNAME \-nameserver $LXC_DNS -searchdomain $LXC_DOMAIN -onboot 1 -timezone $LXC_TIMEZONE -features nesting=$LXC_NESTING -net0 name=eth0,bridge=$LXC_BRIDGE,firewall=1,gw=$LXC_GW,ip=$LXC_IP,type=veth$VLAN; +pct set $LXC_NBR -memory $LXC_MEM -swap $LXC_SWAP -hostname $LXC_HOSTNAME -onboot 1 -timezone $LXC_TIMEZONE -features nesting=$LXC_NESTING; +if [ $LXC_DHCP == true ]; then + pct set $LXC_NBR -net0 name=eth0,bridge=$LXC_BRIDGE,ip=dhcp,type=veth$VLAN; +else + pct set $LXC_NBR -net0 name=eth0,bridge=$LXC_BRIDGE,firewall=1,gw=$LXC_GW,ip=$LXC_IP,type=veth$VLAN -nameserver $LXC_DNS -searchdomain $LXC_DOMAIN; +fi sleep 2 if [ $LXC_MP -gt 0 ]; then diff --git a/zamba.conf b/zamba.conf index 59816c5..11738a4 100644 --- a/zamba.conf +++ b/zamba.conf @@ -39,6 +39,9 @@ LXC_HOSTNAME="zamba" # Defines the domain name / search domain of your LXC container LXC_DOMAIN="zmb.rocks" +# Enable DHCP on LAN (eth0) - (Obtain an IP address automatically) [true/false] +LXC_DHCP=false + # Defines the local IP address and subnet of your LXC container in CIDR format LXC_IP="192.168.100.200/24" diff --git a/zamba.conf.md b/zamba.conf.md index 1dfdd40..a4c3114 100644 --- a/zamba.conf.md +++ b/zamba.conf.md @@ -57,6 +57,11 @@ Defines the domain name / search domain of your LXC container ```bash LXC_DOMAIN="zmb.rocks" ``` +### LXC_DHCP +Enable DHCP on LAN (eth0) - (Obtain an IP address automatically) [true/false] +```bash +LXC_DHCP=false +``` ### LXC_IP Defines the local IP address and subnet of your LXC container in CIDR format ```bash diff --git a/zmb-standalone.sh b/zmb-standalone.sh index 85ab941..a3077fd 100644 --- a/zmb-standalone.sh +++ b/zmb-standalone.sh @@ -25,7 +25,7 @@ smbpasswd -x $USER (echo $ZMB_ADMIN_PASS; echo $ZMB_ADMIN_PASS) | smbpasswd -a $USER cat << EOF >> /etc/samba/smb.conf -[share] +[$ZMB_SHARE] comment = Main Share path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE read only = No