formatting, clean up

pull/404/head
Paul Philippov 2022-08-24 19:00:49 -04:00
parent a29e8dccba
commit a6e8b5b3e1
1 changed files with 80 additions and 80 deletions

View File

@ -66,7 +66,6 @@ do_update_rootfs() {
unset x
}
do_wipe_overlay() {
echo_c 33 "\nOverlayFS"
echo "Erase overlay partition"
@ -108,11 +107,11 @@ free_resources() {
done
echo ". OK"
done
sync; echo 3 > /proc/sys/vm/drop_caches
sync; echo 3 >/proc/sys/vm/drop_caches
}
self_update() {
if echo "${args}" | grep "rootfs" || echo "${args}" | grep "kernel" || echo "${args}" | grep -- "-n" > /dev/null 2>&1; then
if echo "${args}" | grep "rootfs" || echo "${args}" | grep "kernel" || echo "${args}" | grep -- "-n" >/dev/null 2>&1; then
echo -e "\nOffline upgrade or Overlay clean, skip sysupgrade version check."
else
echo -e "\nOnline upgrade, checking sysupgrade version..."
@ -172,7 +171,7 @@ print_sysinfo() {
print_usage() {
echo "
Usage: $0 [options]
Where:
-k update kernel from online repository
-r update rootfs from online repository
--url=[URL] custom URL to update from (.tgz format)
@ -223,12 +222,12 @@ for i in "$@"; do
skip_ver=1
shift
;;
-h|--help)
-h | --help)
print_sysinfo
print_usage
exit 0
;;
-k )
-k)
update_kernel=1
remote_update=1
shift
@ -238,7 +237,7 @@ for i in "$@"; do
kernel_file="${i#*=}"
shift
;;
-n|--wipe_overlay)
-n | --wipe_overlay)
clear_overlay=1
shift
;;
@ -256,13 +255,13 @@ for i in "$@"; do
url="${i#*=}"
shift
;;
-x|--no_reboot)
-x | --no_reboot)
skip_reboot=1
shift
;;
*)
print_sysinfo
echo_c 97 "\nUnknown option: $1"
echo_c 37 "\nUnknown option: $1"
print_usage
exit 1
;;
@ -280,6 +279,7 @@ exit 0
self_update
create_lock
free_resources
[ "$remote_update" -eq 1 ] && download_firmware
[ "$update_kernel" -eq 1 ] && do_update_kernel "$kernel_file"
[ "$update_rootfs" -eq 1 ] && do_update_rootfs "$rootfs_file"