Enabling and disabling gpgit
This commit is contained in:
parent
8bec2b165c
commit
24f89a0323
|
@ -32,14 +32,16 @@ function enable_email_encryption_at_rest {
|
|||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if grep '#/usr/bin/gpgit.pl' /home/$USERNAME/.procmailrc; then
|
||||
sed -i 's|#/usr/bin/gpgit.pl|/usr/bin/gpgit.pl|g' /home/$USERNAME/.procmailrc
|
||||
if grep '#| /usr/bin/gpgit.pl' /home/$USERNAME/.procmailrc; then
|
||||
sed -i 's@#| /usr/bin/gpgit.pl@| /usr/bin/gpgit.pl@g' /home/$USERNAME/.procmailrc
|
||||
sed -i 's|#:0 f|:0 f|g' /home/$USERNAME/.procmailrc
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if grep '#/usr/bin/gpgit.pl' /etc/skel/.procmailrc; then
|
||||
sed -i 's|#/usr/bin/gpgit.pl|/usr/bin/gpgit.pl|g' /etc/skel/.procmailrc
|
||||
if grep '#| /usr/bin/gpgit.pl' /etc/skel/.procmailrc; then
|
||||
sed -i 's@#| /usr/bin/gpgit.pl@| /usr/bin/gpgit.pl@g' /etc/skel/.procmailrc
|
||||
sed -i 's|#:0 f|:0 f|g' /etc/skel/.procmailrc
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -47,14 +49,16 @@ function disable_email_encryption_at_rest {
|
|||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
|
||||
if ! grep '#/usr/bin/gpgit.pl' /home/$USERNAME/.procmailrc; then
|
||||
sed -i 's|/usr/bin/gpgit.pl|#/usr/bin/gpgit.pl|g' /home/$USERNAME/.procmailrc
|
||||
if ! grep '#| /usr/bin/gpgit.pl' /home/$USERNAME/.procmailrc; then
|
||||
sed -i 's@| /usr/bin/gpgit.pl@#| /usr/bin/gpgit.pl@g' /home/$USERNAME/.procmailrc
|
||||
sed -i 's|:0 f|#:0 f|g' /home/$USERNAME/.procmailrc
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if ! grep '#/usr/bin/gpgit.pl' /etc/skel/.procmailrc; then
|
||||
sed -i 's|/usr/bin/gpgit.pl|#/usr/bin/gpgit.pl|g' /etc/skel/.procmailrc
|
||||
if ! grep '#| /usr/bin/gpgit.pl' /etc/skel/.procmailrc; then
|
||||
sed -i 's@| /usr/bin/gpgit.pl@#| /usr/bin/gpgit.pl@g' /etc/skel/.procmailrc
|
||||
sed -i 's|:0 f|#:0 f|g' /etc/skel/.procmailrc
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue