#!/bin/bash

/bin/mkdir -p /usr/share/AnNyung
/bin/curl http://mirror.oops.org/pub/AnNyung/3/inst/functions -o /usr/share/AnNyung/functions || \
/bin/curl http://ftp.kr.freebsd.org/pub/AnNyung/3/inst/functions -o /usr/share/AnNyung/functions

[[ ! -f /usr/share/AnNyung/functions ]] && {
	echo "Failure donwload AnNyung functions!" &> /dev/stdout
	exit 1
}

source /usr/share/AnNyung/functions

# if don't install annyung-release, install it
an_release

# Set system character set
an_setlang ko_KR.UTF-8

an_x86_64_fix
an_pkgupdate

# Removed useless firmware
an_remfirmware

if [[ -z $kick ]]; then
	# Remove useless packages
	an_pkgrem libgudev1 libmodman libndp libnl3 libpcap libproxy nettle
	an_pkgrem Networkmanager 'NetworkManager-*' dnsmasq
	an_pkgrem firewalld iptables-services postfix wireless-tools
	an_pkgrem gnutls gsettings-desktop-schemas jansson
	an_pkgrem ppp trousers wpa_supplicant

	# Installing default packages
	an_pkginst GeoIP bind-utils bridge-utils nscd ntsysv
	an_pkginst oops-firewall sysstat tmpwatch
	an_pkginst utf8-profile vim-enhanced
	an_pkginst yum-cron yum-annyung jfbterm
fi

an_nozeroconf
an_ipv6_off
an_selinux_off

an_service off postfix
an_service on chronyd yum-cron nscd irqbalance

an_userdel games
an_grpdel games

/sbin/annyung-init-banner

an_yumblock
an_yumcron
an_end

exit 0

#
# Local variables:
# tab-width: 4
# c-basic-offset: 4
# End:
# vim: set filetype=sh noet sw=4 ts=4 fdm=marker:
# vim<600: noet sw=4 ts=4:
#
