#!/bin/bash
#set -e
###############################################################################
# Author	:	Erik Dubois
# Website	:	https://www.erikdubois.be
# Website	:	https://www.arcolinux.info
# Website	:	https://www.arcolinux.com
# Website	:	https://www.arcolinuxd.com
# Website	:	https://www.arcolinuxb.com
# Website	:	https://www.arcolinuxforum.com
###############################################################################
#
#   DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
###############################################################################

echo "###############################################################################"
echo "Copying /etc/pacman.d/gnupg/gpg.conf from ArcoLinux"
echo "###############################################################################"

file_boolean=0

function check_file() {

	file="/usr/local/share/arcolinux/gpg.conf"
	if [[ -f $file ]];then
    	echo $file " exists"
    	file_boolean=1
	else
    	echo $file " doesn't exist"
    	file_boolean=0
	fi
}

check_file

# pacman gpg config + not online
if [ $file_boolean -eq 1 ] ; then
	sudo cp /usr/local/share/arcolinux/gpg.conf /etc/pacman.d/gnupg/gpg.conf
	echo "/etc/pacman.d/gnupg/gpg.conf copied from local system"
fi


echo "###############################################################################"
echo "###                DONE - YOU CAN CLOSE THIS WINDOW                        ####"
echo "###############################################################################"