diff options
Diffstat (limited to 'served/things/memoryleak/files/pull')
-rwxr-xr-x | served/things/memoryleak/files/pull | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/served/things/memoryleak/files/pull b/served/things/memoryleak/files/pull new file mode 100755 index 0000000..3268886 --- /dev/null +++ b/served/things/memoryleak/files/pull @@ -0,0 +1,33 @@ +#!/bin/ash + +#find /root -type f > /root/files +#for dir in $(ls /); do +# # we ignore root because we use it to prime the file above +# if [[ "$dir" != "proc" ]] && \ +# [[ "$dir" != "dev" ]] && \ +# [[ "$dir" != "sys" ]] && \ +# [[ "$dir" != "run" ]] && \ +# [[ "$dir" != "tmp" ]] && \ +# [[ "$dir" != "root" ]]; then +# find /$dir -type f >> /root/files +# fi +#done +#exit + +sleep 12 + +find / -type f > /root/files + +sleep 3 + +file=$(shuf -n 1 /root/files) + +echo "$(date) deleting $file" | tee -a /root/did + +curl -X POST -H "x-api-key: REDACTED" -H "Content-Type: application/json" \ + "https://feeling.nyble.dev/amble.quest/memoryleak" \ + -d "{\"status\": \"Deleting \`$file\`. Did I need that?\", \"visibility\": \"unlisted\", \"content_type\": \"text/markdown\"}" + +rm -rf $file +sleep 5 +poweroff |