mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-03-09 15:40:13 +00:00
feat: initial upload
Initial public release
This commit is contained in:
commit
85a5bd66e0
30 changed files with 943 additions and 0 deletions
37
scripts/00_prereq_check.sh
Executable file
37
scripts/00_prereq_check.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Source our common vars
|
||||
scripts_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. ${scripts_path}/vars.sh
|
||||
|
||||
debug_msg "Starting 00_prereq_check.sh"
|
||||
|
||||
# Check for required utils
|
||||
for bin in losetup docker wget sudo unsquashfs; do
|
||||
if ! which ${bin} > /dev/null; then
|
||||
error_msg "${bin} is missing! Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Make sure loop module is loaded
|
||||
if [ ! -d /sys/module/loop ]; then
|
||||
error_msg "Loop module isn't loaded into the kernel! This is REQUIRED! Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate FW is downloaded
|
||||
if ! [ -f "${root_path}/unifi-firmware/${firmware_filename}" ]; then
|
||||
echo "Error: File ${firmware_filename} does not exist in ./unifi-firmware! Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Does the checksum match?
|
||||
file_md5=$(md5sum ${root_path}/unifi-firmware/${firmware_filename} | awk '{print $1}')
|
||||
if [ "$file_md5" != "${firmware_md5}" ]; then
|
||||
echo "Error: File ${firmware_filename} does not have the expected checksum! This is either the wrong file, or it's corrupted. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
debug_msg "Finished 00_prereq_check.sh"
|
Loading…
Add table
Add a link
Reference in a new issue