6.2_disable_avahi_server.sh 6.3_disable_print_server.sh 6.4_disable_dhcp.sh 6.5_configure_ntp.sh 6.6_diable_ldap.sh 6.7_disable_nfs_rpc.sh 6.8_disable_dns_server.sh

This commit is contained in:
thibault.dewailly
2016-04-12 11:21:36 +02:00
parent 9ee7b646bf
commit 4d5ccf1f58
25 changed files with 483 additions and 1 deletions

View File

@ -107,7 +107,16 @@ add_end_of_file() {
echo "$2" >> $FILE
}
add_line_file_before_pattern() {
local FILE=$1
local LINE=$2
local PATTERN=$3
debug "Inserting $LINE before $PATTERN in $FILE"
debug "sed -i '/$PATTERN/i $LINE' $FILE"
sed -i "/$PATTERN/i $LINE" $FILE
FNRET=0
}
#
# User manipulation
#
@ -242,7 +251,7 @@ remount_partition() {
}
#
# Helper functions to work with apt
# APT manipulation
#
apt_update_if_needed()
@ -279,6 +288,14 @@ apt_check_updates()
rm $DETAILS
}
apt_install()
{
local PACKAGE=$1
DEBIAN_FRONTEND='noninteractive' apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $PACKAGE -y
FNRET=0
}
#
# Returns if a package is installed
#