Browse Source

fix: apt auto install

kotoyuuko 6 months ago
parent
commit
721b778683
2 changed files with 5 additions and 5 deletions
  1. 3 3
      01_server_init.sh
  2. 2 2
      04_allow_cloudflare.sh

+ 3 - 3
01_server_init.sh

@@ -49,7 +49,7 @@ mount -a
 
 # setup ntp
 apt update
-apt install chrony
+apt install -y chrony
 systemctl enable chrony
 systemctl restart chrony
 
@@ -61,7 +61,7 @@ systemctl restart sshd
 
 # setup fail2ban
 apt update
-apt install fail2ban
+apt install -y fail2ban
 cat > /etc/fail2ban/jail.local << EOF
 [DEFAULT]
 ignoreip = 127.0.0.1/8 ::1
@@ -78,7 +78,7 @@ systemctl enable fail2ban
 systemctl restart fail2ban
 
 # setup ufw
-apt install ufw
+apt install -y ufw
 ufw default deny incoming
 ufw default allow outgoing
 sed -i 's/IPV6=no/IPV6=yes/' /etc/default/ufw

+ 2 - 2
04_allow_cloudflare.sh

@@ -9,11 +9,11 @@ mkdir -p /scripts/cloudflare
 mv update_cloudflare_ips_for_ufw.sh /scripts/cloudflare/
 mv update_cloudflare_ips_for_nginx.sh /scripts/cloudflare/
 chmod +x /scripts/cloudflare/update_cloudflare_ips_for_ufw.sh
-chmod +x /scripts/cloudflare/update_cloudflare_ips_for_nginx.sh /etc/nginx/cloudflare/real_ip.conf
+chmod +x /scripts/cloudflare/update_cloudflare_ips_for_nginx.sh
 
 # run scripts
 bash /scripts/cloudflare/update_cloudflare_ips_for_ufw.sh
-bash /scripts/cloudflare/update_cloudflare_ips_for_nginx.sh
+bash /scripts/cloudflare/update_cloudflare_ips_for_nginx.sh /etc/nginx/cloudflare/real_ip.conf
 
 # tasks
 UFW_JOB="0 3 * * * /scripts/cloudflare/update_cloudflare_ips_for_ufw.sh > /dev/null 2>&1"