Skip to content

Commit

Permalink
Add tests for rule accounts_minimum_age_login_defs
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmarhefka committed Mar 22, 2021
1 parent 6fbb68c commit bf3d225
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
@@ -0,0 +1,7 @@
#!/bin/bash

grep -q "^PASS_MIN_DAYS" /etc/login.defs && \
sed -i "s/PASS_MIN_DAYS.*/PASS_MIN_DAYS\t0/g" /etc/login.defs
if ! [ $? -eq 0 ]; then
echo -e "PASS_MIN_DAYS\t0" >> /etc/login.defs
fi
@@ -0,0 +1,7 @@
#!/bin/bash

grep -q "^PASS_MIN_DAYS" /etc/login.defs && \
sed -i "s/PASS_MIN_DAYS.*/# PASS_MIN_DAYS\t1/g" /etc/login.defs
if ! [ $? -eq 0 ]; then
echo -e "# PASS_MIN_DAYS\t1" >> /etc/login.defs
fi
@@ -0,0 +1,7 @@
#!/bin/bash

grep -q "^PASS_MIN_DAYS" /etc/login.defs && \
sed -i "s/PASS_MIN_DAYS.*/PASS_MIN_DAYS\t7/g" /etc/login.defs
if ! [ $? -eq 0 ]; then
echo -e "PASS_MIN_DAYS\t7" >> /etc/login.defs
fi
@@ -0,0 +1,7 @@
#!/bin/bash

grep -q "^PASS_MIN_DAYS" /etc/login.defs && \
sed -i "s/PASS_MIN_DAYS.*/PASS_MIN_DAYS\t-1/g" /etc/login.defs
if ! [ $? -eq 0 ]; then
echo -e "PASS_MIN_DAYS\t-1" >> /etc/login.defs
fi
@@ -0,0 +1,3 @@
#!/bin/bash

sed -i "/PASS_MIN_DAYS.*/d" /etc/login.defs

0 comments on commit bf3d225

Please sign in to comment.