mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 23:49:46 +00:00
add cpu temp display and optimize user check
This commit is contained in:
@@ -375,7 +375,6 @@ scan_purge_targets() {
|
||||
while IFS= read -r item; do
|
||||
# Check if we should abort (scanning file removed by Ctrl+C)
|
||||
if [[ ! -f "$stats_dir/purge_scanning" ]]; then
|
||||
rm -f "$output_file.raw"
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -413,7 +412,6 @@ scan_purge_targets() {
|
||||
while IFS= read -r item; do
|
||||
# Check if we should abort (scanning file removed by Ctrl+C)
|
||||
if [[ ! -f "$stats_dir/purge_scanning" ]]; then
|
||||
rm -f "$output_file.raw"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
@@ -260,11 +260,20 @@ get_user_home() {
|
||||
}
|
||||
|
||||
get_invoking_user() {
|
||||
if [[ -n "${SUDO_USER:-}" && "${SUDO_USER:-}" != "root" ]]; then
|
||||
echo "$SUDO_USER"
|
||||
if [[ -n "${_MOLE_INVOKING_USER_CACHE:-}" ]]; then
|
||||
echo "$_MOLE_INVOKING_USER_CACHE"
|
||||
return 0
|
||||
fi
|
||||
echo "${USER:-}"
|
||||
|
||||
local user
|
||||
if [[ -n "${SUDO_USER:-}" && "${SUDO_USER:-}" != "root" ]]; then
|
||||
user="$SUDO_USER"
|
||||
else
|
||||
user="${USER:-}"
|
||||
fi
|
||||
|
||||
export _MOLE_INVOKING_USER_CACHE="$user"
|
||||
echo "$user"
|
||||
}
|
||||
|
||||
get_invoking_uid() {
|
||||
|
||||
Reference in New Issue
Block a user