mirror of
https://github.com/buildplan/du_setup.git
synced 2025-12-18 02:05:32 +00:00
Set default user for clean-up mode
This commit is contained in:
parent
3d8d304ac7
commit
dec08d0e4f
11
du_setup.sh
11
du_setup.sh
@ -414,15 +414,8 @@ cleanup_provider_packages() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${USERNAME:-}" ]]; then
|
if [[ -z "${USERNAME:-}" ]]; then
|
||||||
if [[ $EUID -eq 0 ]]; then
|
USERNAME="${SUDO_USER:-root}"
|
||||||
USERNAME="root"
|
log "USERNAME defaulted to '$USERNAME' for cleanup-only mode"
|
||||||
print_warning "USERNAME not set, defaulting to 'root' for cleanup context."
|
|
||||||
log "USERNAME defaulted to 'root' for cleanup-only mode"
|
|
||||||
else
|
|
||||||
USERNAME="${SUDO_USER:-$USER}"
|
|
||||||
print_warning "USERNAME not set, defaulting to '$USERNAME' for cleanup context."
|
|
||||||
log "USERNAME defaulted to '$USERNAME' for cleanup-only mode"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate required variables
|
# Validate required variables
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user