use _root_check

This commit is contained in:
Tobias Powalowski 2024-08-13 23:14:54 +02:00
parent 8ce119af52
commit 0e47c265fc
2 changed files with 3 additions and 11 deletions

View file

@ -16,11 +16,7 @@ _usage()
}
##################################################
[[ -z "${1}" ]] && _usage
### check for root
if ! [[ ${UID} -eq 0 ]]; then
echo "ERROR: Please run as root user!"
exit 1
fi
_root_check
echo -e "\e[1mCleaning blockdevice(s) $*...\e[m"
echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on $* now! \e[m"
sleep 10

View file

@ -14,12 +14,8 @@ _usage()
exit 0
}
##################################################
[[ -z "${1}" ]] && _usage "$@"
### check for root
if ! [[ ${UID} -eq 0 ]]; then
echo "ERROR: Please run as root user!"
exit 1
fi
[[ -z "${1}" ]] && _usage
_root_check
echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on ${1} now! \e[m"
sleep 10
# clean partitiontable