Files
Alte_Skripte/Zeit_Umwandlungen.sh
2026-02-16 15:05:15 +01:00

22 lines
590 B
Bash

#!/bin/bash
################################# Find last Reboot #################################
lastBootRaw=$(sysctl kern.boottime | awk '{print $5}' | tr -d ,)
echo $lastBootRaw
lastBootFormat=$(date -jf "%s" "$lastBootRaw" +"%H:%M:%S")
echo $lastBootFormat
TimeCreate=$(date -r /Users/90022300/Desktop/LastWarningScript.sh +'%s')
echo $TimeCreate
lastTime=$(date -jf "%s" "$TimeCreate" +"%H:%M:%S")
echo $lastTime
################################# Variablen #################################
if [ $lastBootRaw -lt $TimeCreate ]
then
echo "länger"
else
echo "kürzer"
fi