40 lines
1.1 KiB
Bash
40 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# fiels
|
|
input_file=./test_sha1.tmp.txt
|
|
sorted_file=./test_SORTED_sha1.tmp.txt
|
|
# lougs
|
|
info_log=./info_log.log
|
|
error_log=./error_log.log
|
|
|
|
# maek an backup
|
|
echo "maekan a backup"
|
|
cp "$input_file" "$input_file.bak"
|
|
|
|
# start da timer
|
|
echo "startin timer"
|
|
start=$(date +%s)
|
|
|
|
# do da magical sortfuck
|
|
echo "performin da magical sortfuck"
|
|
awk '{val="0x" $1; print strtonum(val),$0 ;}' "$input_file" | sort -n -k 1 | sed 's/^[^ ]* //' > "$sorted_file" 2>> "$error_log"
|
|
echo "finished da magical sortfuck! retcode $?"
|
|
|
|
# end da timer and caluclate duratrion
|
|
echo "endin timer"
|
|
end=$(date +%s)
|
|
duration=$(($end - $start))
|
|
echo "sorted (in theoty) in $duration seconds"
|
|
|
|
# updoot da log
|
|
## can reuse dis in a function or sumshit
|
|
echo "loggin shit"
|
|
echo "$(date): $input_file sorted to $sorted_file in $duration seconds" | tee -a "$info_log"
|
|
|
|
# send silly webhookfuckin
|
|
echo "sendin webhookfuckin"
|
|
webhook "DILDO MACCARONI ITS FOOKAN DONE IN FOOKAN $duration SECONDS" true
|
|
|
|
# mayhaps reboot
|
|
## 10 minute delay to make sure shit fucks
|
|
echo "doin an rebootasn in 10 mins or sumtin"
|
|
sudo shutdown -r +10 "REBOOTFUCKIN IN 10 MINS BITCH" |