Fixed dhcp flag issue as well as ssh public key issue for arch #5
1 changed files with 9 additions and 8 deletions
|
@ -60,9 +60,9 @@ echo ""
|
||||||
|
|
||||||
read -p "Is this correct (y/n)? " v;if [ "$v" != "y" ];then "Exiting, restart to reenter info"; exit;fi
|
read -p "Is this correct (y/n)? " v;if [ "$v" != "y" ];then "Exiting, restart to reenter info"; exit;fi
|
||||||
|
|
||||||
if [ -n $subnet ]; then dhcp_opts=" -s $subnet";fi
|
dhcp_opts=" -m $mac"
|
||||||
|
if [ -n $subnet ]; then dhcp_opts+=" -s $subnet";fi
|
||||||
if [ -n $ip ]; then dhcp_opts+=" -i $ip";fi
|
if [ -n $ip ]; then dhcp_opts+=" -i $ip";fi
|
||||||
dhcp_opts+=" -m $mac"
|
|
||||||
|
|
||||||
lname=`echo $name | tr '[:upper:]' '[:lower:]'`
|
lname=`echo $name | tr '[:upper:]' '[:lower:]'`
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ case "$variant" in
|
||||||
mkdir -p /tmp/cloud-init
|
mkdir -p /tmp/cloud-init
|
||||||
|
|
||||||
echo "#cloud-config
|
echo "#cloud-config
|
||||||
|
users:
|
||||||
- name: root
|
- name: root
|
||||||
ssh_authorized_keys:
|
ssh_authorized_keys:
|
||||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILG56T1k766Cru14kyXI8WXSJwlO2sVhmH6JeRWy+mfe root@host.actcur.com" > /tmp/cloud-init/user-data
|
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILG56T1k766Cru14kyXI8WXSJwlO2sVhmH6JeRWy+mfe root@host.actcur.com" > /tmp/cloud-init/user-data
|
||||||
|
@ -102,14 +103,14 @@ echo "#cloud-config
|
||||||
done
|
done
|
||||||
echo "server up, waiting for ssh"
|
echo "server up, waiting for ssh"
|
||||||
|
|
||||||
sleep 30
|
sleep 60
|
||||||
|
|
||||||
sed "s/REPLACE_HOSTNAME/${lname}.actcur.com/g" ../base_files/user_configuration.json > /tmp/user_configuration.json
|
sed "s/REPLACE_HOSTNAME/${lname}.actcur.com/g" ../base_files/user_configuration.json > /tmp/user_configuration.json
|
||||||
rs=$((root_disk*1024-206))
|
rs=$((root_disk*1024-206))
|
||||||
sed -i "s/REPLACE_SIZE/${rs}/g" /tmp/user_configuration.json
|
sed -i "s/REPLACE_SIZE/${rs}/g" /tmp/user_configuration.json
|
||||||
|
|
||||||
ssh-keygen -R ${lname}.actcur.com
|
ssh-keygen -R ${lname}.actcur.com
|
||||||
ssh-keyscan ${lname}.actcur.com | grep -v "#" | grep "ecdsa-sha2-nistp256" >> ~/.ssh/known_hosts
|
ssh-keyscan ${lname}.actcur.com | grep -v "#" | grep "ssh-ed25519 " >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
scp -i $ssh_key_dir/id_arch_builder /tmp/user_configuration.json ${lname}.actcur.com:/tmp/user_configuration.json
|
scp -i $ssh_key_dir/id_arch_builder /tmp/user_configuration.json ${lname}.actcur.com:/tmp/user_configuration.json
|
||||||
ssh -i $ssh_key_dir/id_arch_builder ${lname}.actcur.com "systemctl mask reflector.service; echo 'Server = https://pkg.actcur.com/repo/archlinux/\$repo/os/\$arch' > /etc/pacman.d/mirrorlist"
|
ssh -i $ssh_key_dir/id_arch_builder ${lname}.actcur.com "systemctl mask reflector.service; echo 'Server = https://pkg.actcur.com/repo/archlinux/\$repo/os/\$arch' > /etc/pacman.d/mirrorlist"
|
||||||
|
@ -154,7 +155,7 @@ echo "server up, waiting for ssh"
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
ssh-keygen -R ${lname}.actcur.com
|
ssh-keygen -R ${lname}.actcur.com
|
||||||
ssh-keyscan ${lname}.actcur.com | grep -v "#" | grep "ecdsa-sha2-nistp256" >> ~/.ssh/known_hosts
|
ssh-keyscan ${lname}.actcur.com | grep -v "#" | grep "ssh-ed25519 " >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
# install some dependencies
|
# install some dependencies
|
||||||
case "$variant" in
|
case "$variant" in
|
||||||
|
|
Loading…
Add table
Reference in a new issue