From ffd5b2884023cd6895f829836d5f18778713d4fe Mon Sep 17 00:00:00 2001 From: Thibault Ayanides Date: Fri, 6 Nov 2020 14:51:26 +0100 Subject: [PATCH] FIX: fix apt autoremove to be non interactive modified: bin/hardening/2.2.10_disable_http_server.sh modified: bin/hardening/2.2.11_disable_imap_pop.sh modified: bin/hardening/2.2.12_disable_samba.sh modified: bin/hardening/2.2.14_disable_snmp_server.sh modified: bin/hardening/2.2.2_disable_xwindow_system.sh modified: bin/hardening/2.2.3_disable_avahi_server.sh modified: bin/hardening/2.2.4_disable_print_server.sh modified: bin/hardening/2.2.5_disable_dhcp.sh modified: bin/hardening/2.2.6_disable_ldap.sh modified: bin/hardening/2.2.7_disable_nfs_rpc.sh modified: bin/hardening/2.2.8_disable_dns_server.sh modified: bin/hardening/2.2.9_disable_ftp.sh modified: bin/hardening/2.3.1_disable_nis.sh modified: bin/hardening/2.3.2_disable_rsh_client.sh modified: bin/hardening/2.3.3_disable_talk_client.sh modified: bin/hardening/2.3.4_telnet_client_not_installed.sh modified: bin/hardening/2.3.5_ldap_client_not_installed.sh --- bin/hardening/2.2.10_disable_http_server.sh | 2 +- bin/hardening/2.2.11_disable_imap_pop.sh | 2 +- bin/hardening/2.2.12_disable_samba.sh | 2 +- bin/hardening/2.2.14_disable_snmp_server.sh | 2 +- bin/hardening/2.2.2_disable_xwindow_system.sh | 2 +- bin/hardening/2.2.3_disable_avahi_server.sh | 2 +- bin/hardening/2.2.4_disable_print_server.sh | 2 +- bin/hardening/2.2.5_disable_dhcp.sh | 2 +- bin/hardening/2.2.6_disable_ldap.sh | 2 +- bin/hardening/2.2.7_disable_nfs_rpc.sh | 2 +- bin/hardening/2.2.8_disable_dns_server.sh | 2 +- bin/hardening/2.2.9_disable_ftp.sh | 2 +- bin/hardening/2.3.1_disable_nis.sh | 2 +- bin/hardening/2.3.2_disable_rsh_client.sh | 2 +- bin/hardening/2.3.3_disable_talk_client.sh | 2 +- bin/hardening/2.3.4_disable_telnet_client.sh | 2 +- bin/hardening/2.3.5_disable_ldap_client.sh | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/hardening/2.2.10_disable_http_server.sh b/bin/hardening/2.2.10_disable_http_server.sh index db02370..43f7e13 100755 --- a/bin/hardening/2.2.10_disable_http_server.sh +++ b/bin/hardening/2.2.10_disable_http_server.sh @@ -37,7 +37,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.11_disable_imap_pop.sh b/bin/hardening/2.2.11_disable_imap_pop.sh index 228757e..21b1848 100755 --- a/bin/hardening/2.2.11_disable_imap_pop.sh +++ b/bin/hardening/2.2.11_disable_imap_pop.sh @@ -37,7 +37,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.12_disable_samba.sh b/bin/hardening/2.2.12_disable_samba.sh index d4d4dfd..13547ed 100755 --- a/bin/hardening/2.2.12_disable_samba.sh +++ b/bin/hardening/2.2.12_disable_samba.sh @@ -43,7 +43,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.14_disable_snmp_server.sh b/bin/hardening/2.2.14_disable_snmp_server.sh index 890e1b2..08f7285 100755 --- a/bin/hardening/2.2.14_disable_snmp_server.sh +++ b/bin/hardening/2.2.14_disable_snmp_server.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.2_disable_xwindow_system.sh b/bin/hardening/2.2.2_disable_xwindow_system.sh index 8f18efd..a078b51 100755 --- a/bin/hardening/2.2.2_disable_xwindow_system.sh +++ b/bin/hardening/2.2.2_disable_xwindow_system.sh @@ -37,7 +37,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.3_disable_avahi_server.sh b/bin/hardening/2.2.3_disable_avahi_server.sh index f2d6c96..1ef6560 100755 --- a/bin/hardening/2.2.3_disable_avahi_server.sh +++ b/bin/hardening/2.2.3_disable_avahi_server.sh @@ -35,7 +35,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.4_disable_print_server.sh b/bin/hardening/2.2.4_disable_print_server.sh index 4e484e0..233833b 100755 --- a/bin/hardening/2.2.4_disable_print_server.sh +++ b/bin/hardening/2.2.4_disable_print_server.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.5_disable_dhcp.sh b/bin/hardening/2.2.5_disable_dhcp.sh index ec3a8d9..97530df 100755 --- a/bin/hardening/2.2.5_disable_dhcp.sh +++ b/bin/hardening/2.2.5_disable_dhcp.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.6_disable_ldap.sh b/bin/hardening/2.2.6_disable_ldap.sh index 0aa58b0..53d3f80 100755 --- a/bin/hardening/2.2.6_disable_ldap.sh +++ b/bin/hardening/2.2.6_disable_ldap.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.7_disable_nfs_rpc.sh b/bin/hardening/2.2.7_disable_nfs_rpc.sh index d023eb7..b74da3a 100755 --- a/bin/hardening/2.2.7_disable_nfs_rpc.sh +++ b/bin/hardening/2.2.7_disable_nfs_rpc.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.8_disable_dns_server.sh b/bin/hardening/2.2.8_disable_dns_server.sh index c7ddfe0..b8a4247 100755 --- a/bin/hardening/2.2.8_disable_dns_server.sh +++ b/bin/hardening/2.2.8_disable_dns_server.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.2.9_disable_ftp.sh b/bin/hardening/2.2.9_disable_ftp.sh index 5209d91..3863582 100755 --- a/bin/hardening/2.2.9_disable_ftp.sh +++ b/bin/hardening/2.2.9_disable_ftp.sh @@ -37,7 +37,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.3.1_disable_nis.sh b/bin/hardening/2.3.1_disable_nis.sh index 4425ac4..53ba5fd 100755 --- a/bin/hardening/2.3.1_disable_nis.sh +++ b/bin/hardening/2.3.1_disable_nis.sh @@ -33,7 +33,7 @@ apply () { if [ $FNRET = 0 ]; then crit "$PACKAGE is installed, purging it" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.3.2_disable_rsh_client.sh b/bin/hardening/2.3.2_disable_rsh_client.sh index a6fb834..b4bf677 100755 --- a/bin/hardening/2.3.2_disable_rsh_client.sh +++ b/bin/hardening/2.3.2_disable_rsh_client.sh @@ -36,7 +36,7 @@ apply () { if [ $FNRET = 0 ]; then warn "$PACKAGE is installed, purging" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.3.3_disable_talk_client.sh b/bin/hardening/2.3.3_disable_talk_client.sh index 0513347..427eccb 100755 --- a/bin/hardening/2.3.3_disable_talk_client.sh +++ b/bin/hardening/2.3.3_disable_talk_client.sh @@ -35,7 +35,7 @@ apply () { if [ $FNRET = 0 ]; then warn "$PACKAGE is installed, purging" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.3.4_disable_telnet_client.sh b/bin/hardening/2.3.4_disable_telnet_client.sh index a8a4dc6..3021361 100755 --- a/bin/hardening/2.3.4_disable_telnet_client.sh +++ b/bin/hardening/2.3.4_disable_telnet_client.sh @@ -35,7 +35,7 @@ apply () { if [ $FNRET = 0 ]; then warn "$PACKAGE is installed, purging" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi diff --git a/bin/hardening/2.3.5_disable_ldap_client.sh b/bin/hardening/2.3.5_disable_ldap_client.sh index ecda05d..df2fb9a 100755 --- a/bin/hardening/2.3.5_disable_ldap_client.sh +++ b/bin/hardening/2.3.5_disable_ldap_client.sh @@ -35,7 +35,7 @@ apply () { if [ $FNRET = 0 ]; then warn "$PACKAGE is installed, purging" apt-get purge $PACKAGE -y - apt-get autoremove + apt-get autoremove -y else ok "$PACKAGE is absent" fi