Update setup.sh
This commit is contained in:
parent
00689b0bd4
commit
567d33ff7d
1 changed files with 1 additions and 4 deletions
5
setup.sh
5
setup.sh
|
@ -14,11 +14,8 @@ DEFAULT_SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoxUu/nC1C03LvxIhCMzyMu7C
|
||||||
# Early root escalation
|
# Early root escalation
|
||||||
###############################################################################
|
###############################################################################
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
# Prompt for root password via whiptail if available
|
|
||||||
if command -v whiptail &>/dev/null; then
|
if command -v whiptail &>/dev/null; then
|
||||||
PW=$(whiptail --passwordbox "Root privileges required.
|
PW=$(whiptail --passwordbox "Root privileges required.\nEnter root password:" 10 60 3>&1 1>&2 2>&3) || exit 1
|
||||||
Enter root password:" 10 60 3>&1 1>&2 2>&3) || exit 1
|
|
||||||
# Re-exec under su using stdin for piped or file-based scripts
|
|
||||||
exec su root -c "bash -s -- \"$@\"" <<<"$PW"
|
exec su root -c "bash -s -- \"$@\"" <<<"$PW"
|
||||||
else
|
else
|
||||||
echo "Root privileges required; re-running under su..."
|
echo "Root privileges required; re-running under su..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue