Files
lnx-arch/scripts/archinstall_config_download.sh

45 lines
1007 B
Bash
Raw Normal View History

2024-04-30 07:40:24 -05:00
#!/usr/bin/env bash
# klevstul
2024-08-13 19:37:33 -05:00
echo "<< archinstall_config_download.sh >>"
2024-04-30 07:40:24 -05:00
src_file_conf=user_configuration.json
src_file_cred=user_credentials.json
src_base_url=https://git.mz.fo/fro/lnx-arch/raw/branch/master/dots/archinstall/
trg_dir=/tmp
if [ "$EUID" -ne 0 ]
then echo "error: run as 'root'"
exit
fi
# ---------------------------------
# download user_configuration.json
# ---------------------------------
echo "enter host name:"
read user_input
host_name=${user_input}
src_url=${src_base_url}/${host_name}/${src_file_conf}
curl -o ${trg_dir}/${src_file_conf} ${src_url}
# ---------------------------------
# download user_credentials.json
# ---------------------------------
src_url=${src_base_url}/common/${src_file_cred}
curl -o ${trg_dir}/${src_file_cred} ${src_url}
echo "enter password for user:"
read -s user_input # -s for silent mode (do not display input in cli)
password=${user_input}
sed -i -e "s/<PASSWORD>/${password}/g" ${trg_dir}/${src_file_cred}
2024-06-06 07:54:49 -05:00
ls -al user_c*
2024-06-06 07:57:20 -05:00
date