summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Graham <joseph@fibreglass.tunachunks>2013-07-28 12:47:44 +0100
committerJoseph Graham <joseph@fibreglass.tunachunks>2013-07-28 12:47:44 +0100
commit8884e1fe82dbca61b9bbc6c0decc5c63d48292c9 (patch)
tree1217c04bd1d7d83deaf88c8e25a7d77113c2b9e1
parentf11df7a13ee3a0b560befcb97b77fbf82c53ee2c (diff)
Filesystem updates
-rw-r--r--info/pizza1
-rw-r--r--lib/hack_of_all_hacks54
2 files changed, 1 insertions, 54 deletions
diff --git a/info/pizza b/info/pizza
new file mode 100644
index 0000000..4e07e7e
--- /dev/null
+++ b/info/pizza
@@ -0,0 +1 @@
+Italian
diff --git a/lib/hack_of_all_hacks b/lib/hack_of_all_hacks
deleted file mode 100644
index 7d44292..0000000
--- a/lib/hack_of_all_hacks
+++ /dev/null
@@ -1,54 +0,0 @@
-#! /bin/bash
-
-function l33t_codes
-{
- person="${sender%%!*}"
-
- if [[ ${line} == *"error while loading shared libraries"* ]]
- then
- send_msg '#parabola' "${person}: please report a bug, specifying exact error message, package of the failing command and architecture"
- fi
-
- # If two different people say the same thing in a row then say it again
- # for fun.
- if [[ ${line} == ${lastline} ]] && [[ ${sender%%!*} != ${lastsender} ]]
- then
- send_msg '#parabola' "${line}"
- fi
-
- lastline="${line}"
- lastsender="${sender%%!*}"
-
- # Remove any forward slashes.
- personoslash="${person//\/}"
-
- # Make this person a folder if they don't already have one.
- if ! [[ -d "announcements/people/${personoslash}" ]]
- then
- mkdir -p "announcements/people/${personoslash}"
- touch "announcements/people/${personoslash}/phrases"
- cat << EOF > "announcements/people/${personoslash}/settings"
-enabled=yes
-locked=no
-EOF
- fi
-
- the_time_now=$(date +%s)
-
- # If this person has announcements enabled and there is at least one phrase
- # in their file and their seen log exists.
- if grep 'enabled=yes' "announcements/people/${personoslash}/settings" &> /dev/null && (( $( wc -l "announcements/people/${personoslash}/phrases" | cut -d ' ' -f 1 ) )) && [[ -f announcements/people/${personoslash}/seen ]]
- then
- # Check if they were last present more than three hours ago.
- if (( ( $( stat -c %Y announcements/people/${personoslash}/seen ) +
- 10800 ) < the_time_now ))
- then
- send_msg '#parabola' \
- "$( shuf "announcements/people/${personoslash}/phrases" | head -1 )"
- fi
-
- fi
-
- # Record that the person has been seen, and when.
- touch "announcements/people/${personoslash}/seen"
-}