<commit_before>#!/bin/bash 
#
# safepac 0.2 - A slightly safer auto-updater for pacman
# Copyright (C) 2008 <NAME> <shapeshifter at archlinux dot us>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.


#Check for prerequisites
(( $UID != 0 )) && echo "You need to run this script as root" && exit 1
if [[ ! $(command -v curl) ]] || [[ ! $(command -v links) ]]; then
	printf "You need at least curl and links to use this! A working mail/MTA setup with a profile named safepac is optional for sending daily digests" && exit 1
fi

whitelist="/etc/safepac/whitelist"
ignorelist="/etc/safepac/ignorelist"
safepacrc="/etc/safepac/safepacrc"

#Creating file structure if necessary
if [[ ! -e $safepacrc ]]; then
	echo "No configuration file /etc/safepac/safepacrc found."
	if [[ ! -d /etc/safepac/ ]]; then
		mkdir -p /etc/safepac/digest
	fi
	exit 1
else
	. $safepacrc
fi

if [[ ! -e $whitelist ]]; then
	touch $whitelist
	touch $ignorelist<commit_msg>Update safepac.bash<commit_after>#!/bin/bash 
#
# safepac 0.2 - A slightly safer auto-updater for pacman
# Copyright (C) 2008 <NAME> <shapeshifter at archlinux dot us>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# See https://bbs.archlinux.org/viewtopic.php?id=66822 for more details


#Check for prerequisites
(( $UID != 0 )) && echo "You need to run this script as root" && exit 1
if [[ ! $(command -v curl) ]] || [[ ! $(command -v links) ]]; then
	printf "You need at least curl and links to use this! A working mail/MTA setup with a profile named safepac is optional for sending daily digests" && exit 1
fi

whitelist="/etc/safepac/whitelist"
ignorelist="/etc/safepac/ignorelist"
safepacrc="/etc/safepac/safepacrc"

#Creating file structure if necessary
if [[ ! -e $safepacrc ]]; then
	echo "No configuration file /etc/safepac/safepacrc found."
	if [[ ! -d /etc/safepac/ ]]; then
		mkdir -p /etc/safepac/digest
	fi
	exit 1
else
	. $safepacrc
fi

if [[ ! -e $whitelist ]]; then
	touch $whitelist
	touch $ignorelist
{'fraction_non_alphanumeric': 0.10185509275463774, 'fraction_numerical': 0.009450472523626182, 'mean_word_length': 3.9965034965034967, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4965662', 'n_tokens_mistral': 952, 'n_tokens_neox': 860, 'n_words': 383}