63 lines
1.7 KiB
Plaintext
63 lines
1.7 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
Main() {
|
||
|
resp=$(curl -s -o /dev/null -I -w "%{http_code}" http://192.168.0.250/cache/x86_64/)
|
||
|
|
||
|
if [ $resp -eq 200 ]; then
|
||
|
sudo cp /etc/pacman-cache.conf /etc/pacman.conf
|
||
|
else
|
||
|
sudo cp /etc/pacman-std.conf /etc/pacman.conf
|
||
|
fi
|
||
|
|
||
|
local progname
|
||
|
progname="$(basename "$0")"
|
||
|
local log=/home/liveuser/melawy-install.log
|
||
|
local mode=""
|
||
|
|
||
|
case "$progname" in
|
||
|
calamares-online) mode=online ;;
|
||
|
calamares-offline) mode=offline ;;
|
||
|
esac
|
||
|
mode=online # keep this line for now!
|
||
|
|
||
|
local _efi_check_dir="/sys/firmware/efi"
|
||
|
local _exitcode=2 # by default use grub
|
||
|
|
||
|
local SYSTEM=""
|
||
|
local BOOTLOADER=""
|
||
|
if [ -d "${_efi_check_dir}" ]; then
|
||
|
SYSTEM="UEFI SYSTEM"
|
||
|
else
|
||
|
SYSTEM="BIOS/MBR SYSTEM"
|
||
|
fi
|
||
|
|
||
|
cat <<EOF > $log
|
||
|
########## $log by $progname
|
||
|
########## Started (UTC): $(date -u "+%x %X")
|
||
|
########## Install mode: $mode
|
||
|
########## System: $SYSTEM
|
||
|
########## Bootloader: $BOOTLOADER
|
||
|
EOF
|
||
|
if [ -f "/etc/calamares/settings_${mode}.conf" ]; then
|
||
|
sudo cp /etc/calamares/settings_${mode}.conf /etc/calamares/settings.conf
|
||
|
fi
|
||
|
|
||
|
if [ -f "/usr/share/calamares/settings_${mode}.conf" ]; then
|
||
|
sudo cp /usr/share/calamares/settings_${mode}.conf /usr/share/calamares/settings.conf
|
||
|
fi
|
||
|
|
||
|
platform="$XDG_SESSION_TYPE"
|
||
|
|
||
|
if [ -z $platform ]; then
|
||
|
platform=$(loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type | cut -d"=" -f 2)
|
||
|
fi
|
||
|
|
||
|
if [ -n "$platform" ] && [ "$platform" == "wayland" ]; then
|
||
|
sudo -E dbus-launch calamares -D8 -d -platform $platform >> $log
|
||
|
else
|
||
|
sudo -E dbus-launch calamares -D8 >> $log
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
Main "$@"
|