mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 11:20:15 +00:00
Merge pull request #1276 from orazioedoardo/disable-progress-bar
Disable progress bar when running unattended
This commit is contained in:
commit
ba92faa15d
1 changed files with 17 additions and 8 deletions
|
@ -540,6 +540,10 @@ installDependentPackages(){
|
||||||
local APTLOGFILE
|
local APTLOGFILE
|
||||||
APTLOGFILE="$($SUDO mktemp)"
|
APTLOGFILE="$($SUDO mktemp)"
|
||||||
|
|
||||||
|
if [ "${runUnattended}" = 'true' ]; then
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
$SUDO ${PKG_INSTALL} "${TO_INSTALL[@]}"
|
||||||
|
else
|
||||||
if command -v debconf-apt-progress > /dev/null; then
|
if command -v debconf-apt-progress > /dev/null; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
$SUDO debconf-apt-progress --logfile "${APTLOGFILE}" -- ${PKG_INSTALL} "${TO_INSTALL[@]}"
|
$SUDO debconf-apt-progress --logfile "${APTLOGFILE}" -- ${PKG_INSTALL} "${TO_INSTALL[@]}"
|
||||||
|
@ -547,6 +551,7 @@ installDependentPackages(){
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
$SUDO ${PKG_INSTALL} "${TO_INSTALL[@]}"
|
$SUDO ${PKG_INSTALL} "${TO_INSTALL[@]}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
local FAILED=0
|
local FAILED=0
|
||||||
|
|
||||||
|
@ -1238,12 +1243,16 @@ installWireGuard(){
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
if (whiptail --title "Install WireGuard" --yesno "Your Raspberry Pi is running kernel package ${INSTALLED_KERNEL}, however the latest version is ${CANDIDATE_KERNEL}.\n\nInstalling WireGuard requires the latest kernel, so to continue, first you need to upgrade all packages, then reboot, and then run the script again.\n\nProceed to the upgrade?" ${r} ${c}); then
|
if (whiptail --title "Install WireGuard" --yesno "Your Raspberry Pi is running kernel package ${INSTALLED_KERNEL}, however the latest version is ${CANDIDATE_KERNEL}.\n\nInstalling WireGuard requires the latest kernel, so to continue, first you need to upgrade all packages, then reboot, and then run the script again.\n\nProceed to the upgrade?" ${r} ${c}); then
|
||||||
|
if [ "${runUnattended}" = 'true' ]; then
|
||||||
|
$SUDO ${PKG_MANAGER} upgrade -y
|
||||||
|
else
|
||||||
if command -v debconf-apt-progress &> /dev/null; then
|
if command -v debconf-apt-progress &> /dev/null; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
$SUDO debconf-apt-progress -- ${PKG_MANAGER} upgrade -y
|
$SUDO debconf-apt-progress -- ${PKG_MANAGER} upgrade -y
|
||||||
else
|
else
|
||||||
$SUDO ${PKG_MANAGER} upgrade -y
|
$SUDO ${PKG_MANAGER} upgrade -y
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
if (whiptail --title "Reboot" --yesno "You need to reboot after upgrading to run the new kernel.\n\nWould you like to reboot now?" ${r} ${c}); then
|
if (whiptail --title "Reboot" --yesno "You need to reboot after upgrading to run the new kernel.\n\nWould you like to reboot now?" ${r} ${c}); then
|
||||||
whiptail --title "Rebooting" --msgbox "The system will now reboot.\n\nWhen you come back, just run the installation command again:\n\n curl -L https://install.pivpn.io | bash" ${r} ${c}
|
whiptail --title "Rebooting" --msgbox "The system will now reboot.\n\nWhen you come back, just run the installation command again:\n\n curl -L https://install.pivpn.io | bash" ${r} ${c}
|
||||||
printf "\\nRebooting system...\\n"
|
printf "\\nRebooting system...\\n"
|
||||||
|
|
Loading…
Reference in a new issue