firmware/general/overlay/usr/sbin/firstboot

29 lines
431 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/sh
#
# OpenIPC.org | v.20210821
#
set -e
overlay=$(awk -F ':' '/"rootfs_data"/ {print $1}' /proc/mtd)
clearing_overlayfs() {
echo -e "\n\e[1;31mСlearing the overlayfs partition...\e[0m\n"
flash_eraseall -j /dev/${overlay}
}
quick_reboot() {
echo -e "\n\e[1;31mRebooting without any questions...\e[0m\n"
reboot -f
}
if [ "$1" = "-s" ]; then
clearing_overlayfs
else
clearing_overlayfs && quick_reboot
fi