forked from Bitmessage/sysdeploy
47 lines
645 B
Bash
47 lines
645 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
OSCODENAME=focal
|
||
|
OSVERSION=20.04
|
||
|
|
||
|
function find_oldest()
|
||
|
{
|
||
|
echo
|
||
|
}
|
||
|
|
||
|
function get_latest_maas_id()
|
||
|
{
|
||
|
jq blah $OSCODENAME
|
||
|
}
|
||
|
|
||
|
function get_checksum()
|
||
|
{
|
||
|
jq blah $OSVERSION
|
||
|
}
|
||
|
|
||
|
function download_and_verify()
|
||
|
{
|
||
|
local url="$1"
|
||
|
local checksum="$2"
|
||
|
local fname="$3"
|
||
|
|
||
|
wget "$url" -O "$fname"
|
||
|
if [ "checksum" == "$checksum" ]; then
|
||
|
return 0
|
||
|
fi
|
||
|
return 1
|
||
|
}
|
||
|
|
||
|
function download_files()
|
||
|
{
|
||
|
download kernel
|
||
|
download initrd
|
||
|
download squashfs
|
||
|
|
||
|
dd if=squashfs of="$partition" bs=1M
|
||
|
|
||
|
create_options_file
|
||
|
update_default
|
||
|
delete_oldest_if_needed
|
||
|
update_onerror_second_youngest
|
||
|
}
|