1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Specify terminal device /dev/tty for input

This commit is contained in:
billz 2019-11-19 11:42:06 +00:00
parent cd17379733
commit 11e71a638f
2 changed files with 20 additions and 19 deletions

View File

@ -44,9 +44,9 @@ function config_installation() {
echo "Install directory: ${raspap_dir}" echo "Install directory: ${raspap_dir}"
echo -n "Install to Lighttpd root directory: ${webroot_dir}? [Y/n]: " echo -n "Install to Lighttpd root directory: ${webroot_dir}? [Y/n]: "
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
read -e -p "Enter alternate Lighttpd directory: " -i "/var/www/html" webroot_dir read -e -p < /dev/tty "Enter alternate Lighttpd directory: " -i "/var/www/html" webroot_dir
fi fi
else else
echo -e echo -e
@ -55,7 +55,7 @@ function config_installation() {
echo -n "Complete installation with these values? [Y/n]: " echo -n "Complete installation with these values? [Y/n]: "
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
echo "Installation aborted." echo "Installation aborted."
exit 0 exit 0
@ -130,7 +130,7 @@ function prompt_install_openvpn() {
install_log "Setting up OpenVPN support (beta)" install_log "Setting up OpenVPN support (beta)"
echo -n "Install OpenVPN and enable client configuration? [Y/n]: " echo -n "Install OpenVPN and enable client configuration? [Y/n]: "
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
echo -e echo -e
else else
@ -264,7 +264,7 @@ function default_configuration() {
# Prompt to install RaspAP daemon # Prompt to install RaspAP daemon
echo -n "Enable RaspAP control service (Recommended)? [Y/n]: " echo -n "Enable RaspAP control service (Recommended)? [Y/n]: "
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
echo -e echo -e
else else
@ -372,7 +372,7 @@ function optimize_php() {
echo -n "Enable HttpOnly for session cookies (Recommended)? [Y/n]: " echo -n "Enable HttpOnly for session cookies (Recommended)? [Y/n]: "
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
echo -e echo -e
else else
@ -388,7 +388,7 @@ function optimize_php() {
if [ "$php_package" = "php7.1-cgi" ]; then if [ "$php_package" = "php7.1-cgi" ]; then
echo -n "Enable PHP OPCache (Recommended)? [Y/n]: " echo -n "Enable PHP OPCache (Recommended)? [Y/n]: "
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
echo -e echo -e
else else
@ -417,7 +417,7 @@ function install_complete() {
# With default_configuration this will create an active AP on restart. # With default_configuration this will create an active AP on restart.
if ip a | grep -q ': eth0:.*state UP'; then if ip a | grep -q ': eth0:.*state UP'; then
echo -n "The system needs to be rebooted as a final step. Reboot now? [y/N]: " echo -n "The system needs to be rebooted as a final step. Reboot now? [y/N]: "
read answer read answer < /dev/tty
if [ "$answer" != "${answer#[Nn]}" ]; then if [ "$answer" != "${answer#[Nn]}" ]; then
echo "Installation reboot aborted." echo "Installation reboot aborted."
exit 0 exit 0

View File

@ -16,9 +16,9 @@ function config_installation() {
echo "Current system hostname is $HOSTNAME" echo "Current system hostname is $HOSTNAME"
echo -n "Create an SSL certificate for ${certname}? (Recommended) [y/N]" echo -n "Create an SSL certificate for ${certname}? (Recommended) [y/N]"
if [ $assume_yes == 0 ]; then if [ $assume_yes == 0 ]; then
read answer read answer < /dev/tty
if [[ $answer != "y" ]]; then if [[ $answer != "y" ]]; then
read -e -p "Enter an alternate certificate name: " -i "${certname}" certname read -e -p < /dev/tty "Enter an alternate certificate name: " -i "${certname}" certname
fi fi
else else
echo -e echo -e
@ -26,9 +26,9 @@ function config_installation() {
echo -n "Install to lighttpd SSL directory: ${lighttpd_ssl}? [y/N]: " echo -n "Install to lighttpd SSL directory: ${lighttpd_ssl}? [y/N]: "
if [ $assume_yes == 0 ]; then if [ $assume_yes == 0 ]; then
read answer read answer < /dev/tty
if [[ $answer != "y" ]]; then if [[ $answer != "y" ]]; then
read -e -p "Enter alternate lighttpd SSL directory: " -i "${lighttpd_ssl}" lighttpd_ssl read -e -p < /dev/tty "Enter alternate lighttpd SSL directory: " -i "${lighttpd_ssl}" lighttpd_ssl
fi fi
else else
echo -e echo -e
@ -40,7 +40,7 @@ function config_installation() {
install_divider install_divider
echo -n "Complete installation with these values? [y/N]: " echo -n "Complete installation with these values? [y/N]: "
if [ $assume_yes == 0 ]; then if [ $assume_yes == 0 ]; then
read answer read answer < /dev/tty
if [[ $answer != "y" ]]; then if [[ $answer != "y" ]]; then
echo "Installation aborted." echo "Installation aborted."
exit 0 exit 0
@ -125,12 +125,13 @@ function restart_lighttpd() {
function install_complete() { function install_complete() {
install_log "SSL certificate install completed!" install_log "SSL certificate install completed!"
install_divider install_divider
echo "Open a browser and enter the address: http://${certname}/rootCA.pem" printf '%s\n' \
echo "Download the root certificate to your client and add it to your system keychain." "Open a browser and enter the address: http://$certname/rootCA.pem" \
echo "Note: Be sure to set this certificate to "Always trust" to avoid browser warnings." "Download the root certificate to your client and add it to your system keychain." \
echo "Finally, enter the address https://${certname} in your browser." "Note: Be sure to set this certificate to 'Always trust' to avoid browser warnings." \
echo "Enjoy an encrypted SSL connection to RaspAP 🔒" "Finally, enter the address https://$certname in your browser." \
echo "For advanced options, run mkcert -help" "Enjoy an encrypted SSL connection to RaspAP 🔒" \
"For advanced options, run mkcert -help"
install_divider install_divider
} }