this is horrible

This commit is contained in:
Roxy 2023-05-24 14:54:56 +02:00
commit 856edc1869
6 changed files with 64 additions and 0 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
#cron but worse
## how to use
basically just put it in your home folder and change scripts/paths and stuff
## how make systemd shits work ?
change exec path to where yuo put script duh
## what it do ?
basically just checks if a certain time in HH:MM format is every 60 seconds and if time matches with what is defined in cron-but-worse.xml it will execute what is in the script tag

22
cron-but-worse.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Path to the XML file
xml_file="./cron-but-worse.xml"
while true; do
# Extract the desired times, descriptions, and scripts from the XML file
times=($(grep -oP '<time>\K[^<]+' "$xml_file"))
descriptions=($(grep -oP '<description>\K[^<]+' "$xml_file"))
scripts=($(grep -oP '<script>\K[^<]+' "$xml_file"))
# Get the current time in HH:MM format
current_time=$(date +%H:%M)
for ((i=0; i<${#times[@]}; i++)); do
if [[ $current_time == "${times[i]}" ]]; then
echo "Executing command at $current_time: ${descriptions[i]}"
eval "${scripts[i]}"
fi
done
sleep 60 # Sleep for 1 minute before checking again
done

18
cron-but-worse.xml Normal file
View File

@ -0,0 +1,18 @@
<commands>
<command>
<time>14:45</time>
<description>Play birb sounds for 10 Minutes</description>
<script>/home/sysadmin/vogel-sounds/vogel-10.sh</script>
</command>
<command>
<time>15:30</time>
<description>Play birb sounds for 10 Minutes</description>
<script>/home/sysadmin/vogel-sounds/vogel-10.sh</script>
</command>
<command>
<time>15:45</time>
<description>Play birb sounds for 10 Minutes</description>
<script>/home/sysadmin/vogel-sounds/vogel-10.sh</script>
</command>
</commands>

2
vogel-10.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
aplay ./vogel-10.wav

BIN
vogel-10.wav Normal file

Binary file not shown.

12
vogel-sex.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=play birb sounds at certain times defined in an xml file
After=network.target
[Service]
ExecStart=/bin/bash /home/sysadmin/vogel-sounds/cron-but-worse.sh
User=sysadmin
Restart=always
[Install]
WantedBy=multi-user.target