From bbc1d7a5a3d6847066115111808716e1fb4cbbed Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Fri, 9 Sep 2022 12:14:28 -0600 Subject: [PATCH] Add a few more check to post_install.sh --- post_install.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/post_install.sh b/post_install.sh index c071b0f..fd79ef3 100755 --- a/post_install.sh +++ b/post_install.sh @@ -283,6 +283,42 @@ check_libavif() { return $return_code } +#################### +# Aerc +#################### +aerc_checks() { + check_aerc_accounts +} + +check_aerc_accounts() { + local return_code=0 + + if [[ "$(stat -c "%a" ~/.configs_pointer/aerc/accounts.conf)" != "600" ]]; then + printf "ERR: Aerc's accounts.conf is missing permissions 600\n" + return_code=1 + fi + + return $return_code +} + +#################### +# Git +#################### +git_checks() { + check_gitconfig +} + +check_gitconfig() { + local return_code=0 + + if ! [[ -r ~/.gitconfig ]]; then + printf 'ERR: Missing global gitconfig at ~/.gitconfig\n' + return_code=1 + fi + + return $return_code +} + if [[ "$1" == 'status' && "$(uname -s)" == 'Linux' ]]; then configs_pointer_is_setup || exit 1 @@ -293,6 +329,8 @@ if [[ "$1" == 'status' && "$(uname -s)" == 'Linux' ]]; then fcitx_checks av1_checks tmux_check + aerc_checks + git_checks else print_help fi