use apt-get instead of apt, use DEBIAN_FRONTEND=noninteractive
This commit is contained in:
parent
f0c4df0f90
commit
f7ec743fd1
|
@ -24,6 +24,7 @@ done
|
||||||
# update local server
|
# update local server
|
||||||
echo "Updating .."
|
echo "Updating .."
|
||||||
ssh -T $ssh << EOSSH
|
ssh -T $ssh << EOSSH
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update && apt-get upgrade
|
apt-get update && apt-get upgrade
|
||||||
EOSSH
|
EOSSH
|
||||||
echo "Update complete"
|
echo "Update complete"
|
||||||
|
|
|
@ -7,7 +7,8 @@ fi
|
||||||
|
|
||||||
ssh -T $ssh << EOSSH
|
ssh -T $ssh << EOSSH
|
||||||
echo "Installing Apache2"
|
echo "Installing Apache2"
|
||||||
apt install -y apache2
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y apache2
|
||||||
ufw allow in "WWW Full"
|
ufw allow in "WWW Full"
|
||||||
|
|
||||||
sed -i '/export APACHE_RUN_USER=/c\export APACHE_RUN_USER='"$user" /etc/apache2/envvars
|
sed -i '/export APACHE_RUN_USER=/c\export APACHE_RUN_USER='"$user" /etc/apache2/envvars
|
||||||
|
|
|
@ -7,7 +7,8 @@ sed -i '/PasswordAuthentication/c\PasswordAuthentication no' /etc/ssh/sshd_confi
|
||||||
sed -i '/PermitRootLogin/c\PermitRootLogin prohibit-password' /etc/ssh/sshd_config
|
sed -i '/PermitRootLogin/c\PermitRootLogin prohibit-password' /etc/ssh/sshd_config
|
||||||
systemctl restart sshd
|
systemctl restart sshd
|
||||||
|
|
||||||
apt install -y ufw || (echo "ERROR while installing ufw" ; exit 15)
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y ufw || (echo "ERROR while installing ufw" ; exit 15)
|
||||||
|
|
||||||
ufw allow ssh || (echo "Error while configuring ufw to allow ssh" ; exit 20 )
|
ufw allow ssh || (echo "Error while configuring ufw to allow ssh" ; exit 20 )
|
||||||
yes | ufw enable
|
yes | ufw enable
|
||||||
|
|
|
@ -5,6 +5,7 @@ _home_dir="/home/$user"
|
||||||
ssh -T $ssh << EOSSH
|
ssh -T $ssh << EOSSH
|
||||||
|
|
||||||
echo "Installing packages .."
|
echo "Installing packages .."
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get -y install curl gnupg2 ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip python-pip python3-pip fzf vim ctags
|
apt-get -y install curl gnupg2 ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip python-pip python3-pip fzf vim ctags
|
||||||
|
|
||||||
echo "Installing lazygit .."
|
echo "Installing lazygit .."
|
||||||
|
|
|
@ -14,7 +14,8 @@ ssh -T $ssh << EOSSH
|
||||||
fi
|
fi
|
||||||
echo "Installing MariaDB"
|
echo "Installing MariaDB"
|
||||||
|
|
||||||
apt install -y mariadb-server
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y mariadb-server
|
||||||
|
|
||||||
$_mysql_cmd "DELETE FROM mysql.user WHERE User='';"
|
$_mysql_cmd "DELETE FROM mysql.user WHERE User='';"
|
||||||
$_mysql_cmd "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
|
$_mysql_cmd "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
|
||||||
|
|
|
@ -14,7 +14,8 @@ ssh -T $ssh << EOSSH
|
||||||
fi
|
fi
|
||||||
echo "Installing MySQL"
|
echo "Installing MySQL"
|
||||||
|
|
||||||
apt install -y mysql-server
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y mysql-server
|
||||||
|
|
||||||
$_mysql_cmd "DELETE FROM mysql.user WHERE User='';"
|
$_mysql_cmd "DELETE FROM mysql.user WHERE User='';"
|
||||||
$_mysql_cmd "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
|
$_mysql_cmd "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
|
||||||
|
|
|
@ -9,7 +9,8 @@ if [ -n "$wp_user" ] ; then
|
||||||
echo 'Installing PHP for WordPress ...'
|
echo 'Installing PHP for WordPress ...'
|
||||||
|
|
||||||
ssh -T $ssh << 'EOSSH'
|
ssh -T $ssh << 'EOSSH'
|
||||||
apt install -y php libapache2-mod-php php-fpm php-bcmath php-curl php-gd php-imagick php-mbstring \
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y php libapache2-mod-php php-fpm php-bcmath php-curl php-gd php-imagick php-mbstring \
|
||||||
php-mysql php-soap php-xml php-zip
|
php-mysql php-soap php-xml php-zip
|
||||||
|
|
||||||
_php_config_file=$(php --ini | grep Loaded | awk '{ print $4 }')
|
_php_config_file=$(php --ini | grep Loaded | awk '{ print $4 }')
|
||||||
|
@ -23,6 +24,7 @@ else
|
||||||
echo 'Installing default PHP ...'
|
echo 'Installing default PHP ...'
|
||||||
|
|
||||||
ssh -T $ssh << EOSSH
|
ssh -T $ssh << EOSSH
|
||||||
apt install -y php libapache2-mod-php php-mysql
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get install -y php libapache2-mod-php php-mysql
|
||||||
EOSSH
|
EOSSH
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue