aimee-os/overlay/usr/libexec/factory-reset

12 lines
249 B
Bash
Executable File

#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
DATAPART=$(awk '$2=="/var"{print $1}' /etc/fstab)
dev=$(findfs "${DATAPART}")
if [ -z "${dev}" ]; then
printf 'Could not find data partition (%s)\n' "${DATAPART}" >&2
exit 1
fi
wipefs -fa "${dev}"