Merge pull request #24 from bashclub/main

Add Fixes from main to devel
This commit is contained in:
Thorsten Spille 2021-04-23 19:24:10 +02:00 committed by GitHub
commit a20cf474b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 4 deletions

View File

@ -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 **** **** Zamba LXC Toolbox v0.1 ****
- `locales` are now configured noninteractive #21 - `locales` are now configured noninteractive #21
- timezone is now configured with `pct set` command in `install.sh` #22 - timezone is now configured with `pct set` command in `install.sh` #22

View File

@ -85,7 +85,7 @@ else
fi fi
# Get next free LXC-number # 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)); LXC_CHK=$((LXC_LST+1));
if [ $LXC_CHK -lt 100 ] || [ -f /etc/pve/qemu-server/$LXC_CHK.conf ]; then if [ $LXC_CHK -lt 100 ] || [ -f /etc/pve/qemu-server/$LXC_CHK.conf ]; then
@ -106,7 +106,12 @@ else
VLAN="" VLAN=""
fi fi
# Reconfigure conatiner # 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 sleep 2
if [ $LXC_MP -gt 0 ]; then if [ $LXC_MP -gt 0 ]; then

View File

@ -39,6 +39,9 @@ LXC_HOSTNAME="zamba"
# Defines the domain name / search domain of your LXC container # Defines the domain name / search domain of your LXC container
LXC_DOMAIN="zmb.rocks" 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 # Defines the local IP address and subnet of your LXC container in CIDR format
LXC_IP="192.168.100.200/24" LXC_IP="192.168.100.200/24"

View File

@ -57,6 +57,11 @@ Defines the domain name / search domain of your LXC container
```bash ```bash
LXC_DOMAIN="zmb.rocks" LXC_DOMAIN="zmb.rocks"
``` ```
### LXC_DHCP
Enable DHCP on LAN (eth0) - (Obtain an IP address automatically) [true/false]
```bash
LXC_DHCP=false
```
### LXC_IP ### LXC_IP
Defines the local IP address and subnet of your LXC container in CIDR format Defines the local IP address and subnet of your LXC container in CIDR format
```bash ```bash

View File

@ -25,7 +25,7 @@ smbpasswd -x $USER
(echo $ZMB_ADMIN_PASS; echo $ZMB_ADMIN_PASS) | smbpasswd -a $USER (echo $ZMB_ADMIN_PASS; echo $ZMB_ADMIN_PASS) | smbpasswd -a $USER
cat << EOF >> /etc/samba/smb.conf cat << EOF >> /etc/samba/smb.conf
[share] [$ZMB_SHARE]
comment = Main Share comment = Main Share
path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
read only = No read only = No