-change preference file name: kymsu.pref to kymsu.cfg
-display next update date
This commit is contained in:
2026-09-04 16:47:40 +02:00
parent 92d07bb589
commit d2baa1005d
+12 -12
View File
@@ -1,10 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
#PREF_FILE="$SCRIPT_DIR/kymsu.pref" PREF_FILE="$HOME/.kymsu/plugins.d/kymsu.cfg"
#TEMP_FILE="$SCRIPT_DIR/kymsu.pref.tmp" TEMP_FILE="$HOME/.kymsu/plugins.d/kymsu.cfg.tmp"
PREF_FILE="$HOME/.kymsu/plugins.d/kymsu.pref"
TEMP_FILE="$HOME/.kymsu/plugins.d/kymsu.pref.tmp"
# 5m 5 minutes # 5m 5 minutes
# 2h 2 hours # 2h 2 hours
@@ -39,16 +37,18 @@ fi
current_timestamp=$(date +"%s") current_timestamp=$(date +"%s")
temps=$(( current_timestamp-last_update )) temps=$(( current_timestamp-last_update ))
echo "$w" last_upd=$(date +'%d-%m-%Y %H:%M:%S' -d @$last_update)
# date +'%d-%m-%Y %H:%M:%S' -d @1658067929 echo "Last update: $last_upd"
echo "$last_update"
date +'%d-%m-%Y %H:%M:%S' -d @$last_update current=$(date +'%d-%m-%Y %H:%M:%S' -d @$current_timestamp)
echo "$current_timestamp" echo "Current: $current"
date +'%d-%m-%Y %H:%M:%S' -d @$current_timestamp
echo "$temps" next_update=$(( last_update+w ))
next_upd=$(date +'%d-%m-%Y %H:%M:%S' -d @$next_update)
echo -e "Next update: $next_upd\n"
if [ $(( temps-w )) -gt 0 ]; then if [ $(( temps-w )) -gt 0 ]; then # more than $update_interval
echo "🦄 KYMSU self update" echo "🦄 KYMSU self update"
pushd "$(cat ~/.kymsu/path)" > /dev/null pushd "$(cat ~/.kymsu/path)" > /dev/null
#git pull #git pull