1
0
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:
Copper-Eye
2026-01-13 17:21:03 -04:00
parent 68708484e3
commit fae1c88fa2
5 changed files with 48 additions and 37 deletions

View File

@@ -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

View File

@@ -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() {