fixed directory definitions and added fix_dhcp script

This commit is contained in:
Beth Parker 2025-03-23 06:35:03 -05:00
parent 2822cb946e
commit 83ec431641
4 changed files with 19 additions and 4 deletions

View file

@ -8,7 +8,7 @@ root_disk=10
variant="archlinux" variant="archlinux"
path="default" path="default"
dhcp_opts="" dhcp_opts=""
ssh_key_dir="../identity_files" ssh_key_dir="../../identity_files"
mac=52:54:00:`openssl rand -hex 1`:`openssl rand -hex 1`:`openssl rand -hex 1` mac=52:54:00:`openssl rand -hex 1`:`openssl rand -hex 1`:`openssl rand -hex 1`
branch="prod" branch="prod"

15
scripts/fix_dhcp.sh Normal file
View file

@ -0,0 +1,15 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0")")"
ssh_key_dir="../../identity_files/"
dhcp_dir="../../dhcp_files"
# build dhcp
./shared_scripts/build_dhcp.sh > /tmp/dhcp
# copy dhcp file to router
scp -i $ssh_key_dir/id_router -O /tmp/dhcp r.actcur.com:/etc/config/dhcp
# remove active leases for ip
ssh -i $ssh_key_dir/id_router r.actcur.com "sed -i '/$ip/d' /tmp/dhcp.leases"
# restart dnsmasq
ssh -i $ssh_key_dir/id_router r.actcur.com 'service dnsmasq restart'

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
cd "$(dirname "$(readlink -f "$0")")" cd "$(dirname "$(readlink -f "$0")")"
dhcp_dir="../../dhcp_files" dhcp_dir="../../../dhcp_files"
# use files to build dhcp config file # use files to build dhcp config file
cat $dhcp_dir/base cat $dhcp_dir/base

View file

@ -4,8 +4,8 @@ mac=52:54:00:`openssl rand -hex 1`:`openssl rand -hex 1`:`openssl rand -hex 1`
subnet="172.16.99" subnet="172.16.99"
ip=generate ip=generate
ssh_key_dir="../../identity_files/" ssh_key_dir="../../../identity_files/"
dhcp_dir="../../dhcp_files" dhcp_dir="../../../dhcp_files"
usage="$(basename "$0") [options] server_name usage="$(basename "$0") [options] server_name
where: where: