Merge pull request #4 from skogsbrus/master

Fix bash path to be compatible with non-FHS systems such as NixOS
This commit is contained in:
Andreas Kohlbecker 2023-02-15 22:07:41 +01:00 committed by GitHub
commit 605cbc8b64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
POLL_INTERVAL=10 # seconds
@ -70,7 +70,7 @@ do
if (( $? == 0 )); then
LAST_IFS=$IFS
IFS='
'
'
for sess in ${sessions}; do
act_time=$(tmux display -t $sess -p '#{session_activity}')
if [[ ! -v "act_last[$sess]" ]]; then
@ -80,7 +80,7 @@ do
# echo "###> "$sess' '$(date -Iseconds)' '$act_time' '$act_last[$sess] ## >> tmux-sess-act.log
log_to_bucket $sess
fi
act_current[$sess]=$act_time
act_current[$sess]=$act_time
done
IFS=$LAST_IFS
# copy arrays
@ -90,6 +90,6 @@ do
act_last[$sess]=${act_current[$sess]}
done
fi
sleep $POLL_INTERVAL
done