Skip to content

Commit

Permalink
fix subnets; install git by default
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianVollmer committed Jun 20, 2019
1 parent 0290541 commit 536b189
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions lg-server/bin/lg-config.sh
Expand Up @@ -13,9 +13,9 @@ if [ -z "$LG_ENV_BY_PYTHON" ] ; then
BRIF='br0'
BRIP='192.0.2.1'
GWIP='192.0.2.254' # bogus gateway
ATNET='203.0.113.0/24'
ATIP='203.0.113.1'
WIFINET='198.51.100.0/24'
ATNET='10.47.0.0/24'
ATIP='10.47.0.1'
WIFINET='10.48.0.1/24'
RANGE=61000-62000
TMPDIR="$BD/../.tmp/"
fi
Expand Down
10 changes: 5 additions & 5 deletions lg-server/conf/dnsmasq.conf
Expand Up @@ -107,8 +107,8 @@ port=0
#except-interface=
# Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.)
#ATDHCP#listen-address=203.0.113.37
#WIFI#listen-address=198.51.100.1
#ATDHCP#listen-address=10.47.0.1
#WIFI#listen-address=10.48.0.1
# If you want dnsmasq to provide only DNS service on an interface,
# configure it as shown above, and then use the following line to
# disable DHCP and TFTP on it.
Expand Down Expand Up @@ -154,8 +154,8 @@ port=0
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
#ATDHCP#dhcp-range=%ATIF%,203.0.113.100,203.0.113.200
#WIFI#dhcp-range=%WIFIIF%,198.51.100.100,198.51.100.200
#ATDHCP#dhcp-range=%ATIF%,10.47.0.100,10.47.0.200
#WIFI#dhcp-range=%WIFIIF%,10.48.0.100,10.48.0.200

# This is an example of a DHCP range where the netmask is given. This
# is needed for networks we reach the dnsmasq DHCP server via a relay
Expand Down Expand Up @@ -404,7 +404,7 @@ dhcp-option=6
#dhcp-option=option:domain-search,eng.apple.com,marketing.apple.com

# Send RFC-3442 classless static routes (note the netmask encoding)
#dhcp-option=eth0,121,198.51.100.0/24,203.0.113.37
#dhcp-option=eth0,121,10.48.0.0/24,10.47.0.1

# Send vendor-class specific options encapsulated in DHCP option 43.
# The meaning of the options is defined by the vendor-class so
Expand Down
2 changes: 1 addition & 1 deletion lg-server/conf/interfaces.atif
@@ -1,6 +1,6 @@
auto %ATIF%
allow-hotplug %ATIF%
iface %ATIF% inet static
address 203.0.113.37
address 10.47.0.1
netmask 255.255.255.0

2 changes: 1 addition & 1 deletion lg-server/conf/interfaces.wifi
@@ -1,6 +1,6 @@
auto %WIFIIF%
allow-hotplug %WIFIIF%
iface %WIFIIF% inet static
address 198.51.100.1
address 10.48.0.1
netmask 255.255.255.0

2 changes: 0 additions & 2 deletions lg-server/conf/sshd_config
Expand Up @@ -12,8 +12,6 @@

#Port 22
#AddressFamily any
#ListenAddress 203.0.113.37
#ListenAddress 198.51.100.1
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
Expand Down
7 changes: 5 additions & 2 deletions lg-server/lg-setup.sh
Expand Up @@ -59,6 +59,7 @@ if [[ $DHCP = YES ]] ; then
sed -i "s/^#ATDHCP#//" /etc/dnsmasq.conf
sed -i "s/%ATIF%/$ATIF/g" /etc/dnsmasq.conf /etc/network/interfaces.d/lauschgeraet.atif
fi
echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces

sed -i "s/%ATIF%/$ATIF/g" $rootdir/bin/lg-config.sh
sed -i "s/%CLIF%/$CLIF/g" $rootdir/bin/lg-config.sh /lib/systemd/system/lauschgeraet.service
Expand All @@ -72,14 +73,16 @@ if [[ $WIFIIF != none ]] ; then
sed -i "s/%WIFIIF%/$WIFIIF/g" /etc/hostapd/hostapd.conf /etc/dnsmasq.conf /etc/network/interfaces.d/lauschgeraet.wifi $rootdir/bin/lg-config.sh
sed -i "s/^#WIFI#//" /etc/dnsmasq.conf $rootdir/bin/lg-config.sh
sed -i "s/^wpa_passphrase=.*\$/wpa_passphrase=$wifipw/" /etc/hostapd/hostapd.conf
update-rc.d hostapd defaults
systemctl unmask hostapd
systemctl enable hostapd
fi

echo "[*] Configuring services..."

systemctl enable ssh

if [ $DHCP = YES ] ; then
systemctl unmask dnsmasq
systemctl enable dnsmasq
systemctl enable networking
systemctl disable dhcpcd
Expand All @@ -88,7 +91,7 @@ fi
sleep 1

systemctl enable lauschgeraet
apt-get remove avahi-daemon || true
apt-get -yq remove avahi-daemon || true
systemctl disable systemd-timesyncd.service || true

echo 1 | update-alternatives --config iptables
Expand Down
1 change: 1 addition & 0 deletions requirements-system.txt
Expand Up @@ -10,3 +10,4 @@ net-tools
iproute2
python3
python3-pip
git

0 comments on commit 536b189

Please sign in to comment.