summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-11-04 20:35:05 +0100
committerErich Eckner <git@eckner.net>2024-11-04 20:35:05 +0100
commit9ac0dca2f30b37a9de08e294d52ec9926fb376c0 (patch)
tree1a65c46fb9de0c5cbcd28cb30297cb50e17ec3d9
parent0eed088d428b1ac53f005602bcf2fb585be30b43 (diff)
downloadcomputer-time-limit-9ac0dca2f30b37a9de08e294d52ec9926fb376c0.tar.xz
check yubikey if possible
-rwxr-xr-xcomputer-time-limit17
1 files changed, 15 insertions, 2 deletions
diff --git a/computer-time-limit b/computer-time-limit
index a3a05cb..00d4c86 100755
--- a/computer-time-limit
+++ b/computer-time-limit
@@ -40,8 +40,21 @@ wie_lange_noch() {
ab=$(date +%s)
return
fi
+ home=$(getent passwd "$1" | cut -d: -f6)
+ if [ -d "${home}" ]; then
+ cd "${home}"
+ if [ -f '.shared_secret' ] \
+ && [ -f '/usr/src/skripte/ykverify/verify.py' ] \
+ && ! '/usr/src/skripte/ykverify/verify.py'; then
+ noch=0
+ ab=$(date +%s)
+ cd -
+ return
+ fi
+ cd -
+ fi
erg=$(
- sende_msg start "$1"
+ sende_msg start "$2"
)
if [ -n "${erg}" ] && ! echo "${erg}" | grep -qvx '[0-9]\+'; then
noch="${erg}"
@@ -119,7 +132,7 @@ while true; do
for user in "${!keys[@]}"; do
key="${keys["${user}"]}"
if is_logged_in "${user}"; then
- wie_lange_noch "${key}"
+ wie_lange_noch "${user}" "${key}"
check_time "${user}" "${key}"
else
sende_msg stop "${key}" >/dev/null