Moving away from arch.conf
This commit is contained in:
parent
d71ca1a38b
commit
1613d767bf
4 changed files with 21 additions and 54 deletions
|
|
@ -1,44 +0,0 @@
|
|||
## WK-Arch Settings ##
|
||||
|
||||
# Backup options
|
||||
declare -a BACKUP_1=(
|
||||
"ServerOne" # Server name
|
||||
"10.0.0.10" # IP
|
||||
"Backups" # Share name
|
||||
"backup" # User name
|
||||
"Abracadabra" # Password
|
||||
)
|
||||
declare -a BACKUP_2=(
|
||||
"ServerTwo" # Server name
|
||||
"10.0.0.11" # IP
|
||||
"Backups" # Share name
|
||||
"backup" # User name
|
||||
"Abracadabra" # Password
|
||||
)
|
||||
declare -a BACKUP_3=(
|
||||
"" # Server name
|
||||
"" # IP
|
||||
"" # Share name
|
||||
"" # User name
|
||||
"" # Password
|
||||
)
|
||||
declare -a BACKUP_4=(
|
||||
"" # Server name
|
||||
"" # IP
|
||||
"" # Share name
|
||||
"" # User name
|
||||
"" # Password
|
||||
)
|
||||
|
||||
# Hardware testing options
|
||||
TEST_CPU_LENGTH="7" # Time in minutes to run Prime95
|
||||
|
||||
# Network options
|
||||
WIFI_SSID="SomeWiFi" # Use the 2.4Ghz network for better compatability
|
||||
WIFI_PASS="Abracadabra"
|
||||
|
||||
# Results upload options
|
||||
SKIP_UPLOAD="False" # Set to "True" to disable all uploads
|
||||
DIAG_SERVER="10.0.0.10" # Use the IP and not the server name
|
||||
DIAG_SHARE="/srv/ClientInfo" # Full path to shared folder (relative to the server's root)
|
||||
DIAG_USER="wkdiag" # User used to connect to the server via SSH
|
||||
|
|
@ -12,25 +12,30 @@ die () {
|
|||
}
|
||||
|
||||
function test_connection() {
|
||||
if ip a | grep -Eq '(10.[0-9]+|172.(1[6-9]|2[0-9]|3[0-1]).[0-9]+|192.168).[0-9]+.[0-9]+'; then
|
||||
return 0
|
||||
# Check for a valid private IP
|
||||
if ip a | grep -Eq '10.[0-9]+.[0-9]+.[0-9]+'; then
|
||||
return 0 # Class A
|
||||
elif ip a | grep -Eq '172.(1[6-9]|2[0-9]|3[0-1]).[0-9]+.[0-9]+'; then
|
||||
return 0 # Class B
|
||||
elif ip a | grep -Eq '192.168.[0-9]+.[0-9]+'; then
|
||||
return 0 # Class C
|
||||
else
|
||||
return 1
|
||||
return 1 # Invalid private IP
|
||||
fi
|
||||
}
|
||||
|
||||
# Load settings
|
||||
if [[ -f "/run/archiso/bootmnt/arch/arch.conf" ]]; then
|
||||
source "/run/archiso/bootmnt/arch/arch.conf" || \
|
||||
die "ERROR: failed to load arch.conf (from /run/archiso/bootmnt/arch/)"
|
||||
if [[ -f "/run/archiso/bootmnt/arch/wifi.conf" ]]; then
|
||||
source "/run/archiso/bootmnt/arch/wifi.conf" || \
|
||||
die "ERROR: failed to load wifi.conf (from /run/archiso/bootmnt/arch/)"
|
||||
else
|
||||
source "/usr/local/bin/arch.conf" || \
|
||||
die "ERROR: failed to load arch.conf (from /usr/local/bin/)"
|
||||
source "/usr/local/bin/wifi.conf" || \
|
||||
die "ERROR: failed to load wifi.conf (from /usr/local/bin/)"
|
||||
fi
|
||||
|
||||
# Init
|
||||
WIFI_SSID="${WIFI_SSID}"
|
||||
WIFI_PASS="${WIFI_PASS}"
|
||||
WIFI_PASSWORD="${WIFI_PASSWORD}"
|
||||
|
||||
# Connect to network
|
||||
if ! test_connection; then
|
||||
|
|
@ -49,7 +54,7 @@ if ! test_connection; then
|
|||
## Skip if we're already connected (i.e. the code above worked)
|
||||
if ! test_connection; then
|
||||
echo "Attempting to connect to ${WIFI_SSID}..."
|
||||
nmcli dev wifi connect "${WIFI_SSID}" password "${WIFI_PASS}"
|
||||
nmcli dev wifi connect "${WIFI_SSID}" password "${WIFI_PASSWORD}"
|
||||
sleep 5s
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
# Wizard Kit: Settings - WiFi
|
||||
|
||||
|
|
@ -196,6 +196,10 @@ function update_live_env() {
|
|||
# Wallpaper
|
||||
mkdir -p "$LIVE_DIR/airootfs/usr/share/wallpaper"
|
||||
cp "$ROOT_DIR/Images/Linux.png" "$LIVE_DIR/airootfs/usr/share/wallpaper/burned.in"
|
||||
|
||||
# WiFi
|
||||
echo "WIFI_SSID='$WIFI_SSID'" >> "$LIVE_DIR/airootfs/usr/local/bin/wifi.conf"
|
||||
echo "WIFI_PASSWORD='$WIFI_PASSWORD'" >> "$LIVE_DIR/airootfs/usr/local/bin/wifi.conf"
|
||||
}
|
||||
|
||||
function update_repo() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue