Password package update
This commit is contained in:
@@ -5,10 +5,10 @@ compile:
|
|||||||
@echo Nothing to do
|
@echo Nothing to do
|
||||||
|
|
||||||
install: clean ${binlist} ${filelist}
|
install: clean ${binlist} ${filelist}
|
||||||
mkdir -p ${pkgdir}/opt/aninix/Password/
|
mkdir -p ${pkgdir}/opt/aninix/Password/ ${pkgdir}/usr/lib/systemd/system ${pkgdir}/usr/local/sbin/
|
||||||
for i in ${filelist}; do install -m 0640 -o ldap -g ldap $$i ${pkgdir}/opt/aninix/Password/; done
|
for i in ${filelist}; do install -m 0640 -o ldap -g ldap $$i ${pkgdir}/opt/aninix/Password/; done
|
||||||
mkdir -p ${pkgdir}/usr/local/sbin/
|
|
||||||
for i in ${binlist}; do install -m 0750 -o root -g root $$i ${pkgdir}/usr/local/sbin; done
|
for i in ${binlist}; do install -m 0750 -o root -g root $$i ${pkgdir}/usr/local/sbin; done
|
||||||
|
for i in *.service *.timer; do install -m 0755 -o root -g root $$i ${pkgdir}/usr/lib/systemd/system; done
|
||||||
|
|
||||||
test: compile
|
test: compile
|
||||||
@echo Nothing to do
|
@echo Nothing to do
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
depends=('bash>=4.4' 'openldap')
|
depends=('bash>=4.4' 'openldap' 'ravensend' 'TheRaven')
|
||||||
makedepends=('make>=4.2')
|
makedepends=('make>=4.2')
|
||||||
checkdepends=()
|
checkdepends=()
|
||||||
optdepends=()
|
optdepends=()
|
||||||
|
@@ -9,10 +9,19 @@ function getLDAPAttr() {
|
|||||||
ldapsearch -x "${filter}" "${attribute}" | grep -E "^${attribute}: " | sed "s/${attribute}: //"
|
ldapsearch -x "${filter}" "${attribute}" | grep -E "^${attribute}: " | sed "s/${attribute}: //"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clear cleanup files
|
|
||||||
ldif="/root/cleanup.ldif"
|
ldif="/root/cleanup.ldif"
|
||||||
>"${ldif}"
|
|
||||||
bash="/root/cleanup.bash"
|
bash="/root/cleanup.bash"
|
||||||
|
if [ "$1" == "-h" ]; then
|
||||||
|
cat <<EOM
|
||||||
|
Usage: $0
|
||||||
|
Add -m to mute the use of ravensend.
|
||||||
|
Writes ${ldif} and ${bash} for follow-up by admins.
|
||||||
|
EOM
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clear cleanup files
|
||||||
|
>"${ldif}"
|
||||||
echo "#!/bin/bash" > "${bash}"
|
echo "#!/bin/bash" > "${bash}"
|
||||||
|
|
||||||
# Attributes
|
# Attributes
|
||||||
@@ -84,12 +93,12 @@ fi
|
|||||||
# Report when users are expiring -- give them several notices to fix it.
|
# Report when users are expiring -- give them several notices to fix it.
|
||||||
if [ -n "${EXPIRING}" ]; then
|
if [ -n "${EXPIRING}" ]; then
|
||||||
echo "EXPIRING: ${EXPIRING}"
|
echo "EXPIRING: ${EXPIRING}"
|
||||||
ravensend -c "#tech" -m "The following users are expiring: ${EXPIRING}"
|
if [ "$1" != '-m' ]; then ravensend -c "#tech" -m "The following users are expiring: ${EXPIRING}"; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Report users that have expired. These users should be contacted or removed.
|
# Report users that have expired. These users should be contacted or removed.
|
||||||
if [ -n "${EXPIRED}" ]; then
|
if [ -n "${EXPIRED}" ]; then
|
||||||
echo "EXPIRED: ${EXPIRED}"
|
echo "EXPIRED: ${EXPIRED}"
|
||||||
echo "Expired users can be cleaned up with ${ldif} and ${bash}"
|
echo "Expired users can be cleaned up with ${ldif} and ${bash}. Run /usr/bin/pwck and /usr/bin/grpck afterwards."
|
||||||
ravensend -c "#sharingan" -m 'Users have expired and need attention.'
|
if [ $1 != '-m' ]; then ravensend -c "#sharingan" -m 'The following users have expired and need attention.'; fi
|
||||||
fi
|
fi
|
||||||
|
12
roles/Password/package/ldap-userreport.service
Normal file
12
roles/Password/package/ldap-userreport.service
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=AniNIX/Password | LDAP User Report
|
||||||
|
After=network.target raven.service ravensend-daemon.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/bash /usr/local/sbin/ldap-userreport
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
KillMode=process
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
7
roles/Password/package/ldap-userreport.timer
Normal file
7
roles/Password/package/ldap-userreport.timer
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=AniNIX/Password | LDAP User Report
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=Mon *-*-* 09:00:00
|
||||||
|
RandomizedDelaySec=1m
|
||||||
|
Persistent=true
|
Reference in New Issue
Block a user