Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- offensive ()
- {
- # Requires the offensive fortunes from fortune-mod to be installed; sudo apt install cowsay-off
- # If you're the type of person that turns insults on in sudo then i recommend adding this to your ~/.bash_profile
- fortune -s -n 144 -o
- : <<PACKAGE_NOTES
- $ sudo apt-cache policy cowsay-off fortunes-off funny-manpages
- cowsay-off:
- Installed: 3.03+dfsg2-8
- Candidate: 3.03+dfsg2-8
- Version table:
- *** 3.03+dfsg2-8 500
- 500 https://http.kali.org/kali kali-rolling/main amd64 Packages
- 100 /var/lib/dpkg/status
- fortunes-off:
- Installed: 1:1.99.1-7
- Candidate: 1:1.99.1-7
- Version table:
- *** 1:1.99.1-7 100
- 100 /var/lib/dpkg/status
- funny-manpages:
- Installed: 2.3-1
- Candidate: 2.3-1
- Version table:
- *** 2.3-1 100
- 100 /var/lib/dpkg/status
- PACKAGE_NOTES
- }
- random_cow ()
- {
- if [[ ! -d /usr/share/cowsay/cows ]]; then
- COWPATH=$(find /opt/ /usr/share /usr/local/share ~/ -type d -name 'cows' -exec dirname "{}" \;; find ~/ -type d -name 'cows' -exec dirname "{}" \;);
- fi;
- if [[ ! -n ${COWPATH} ]]; then
- find /usr/share/cowsay/cows/ -type f | grep -Po '(?!\S+[/])[\w\-]+[._]cow' | sed -e 's/[.]cow$//g' | sort -R | head -1;
- else
- find $(tr ':' ' ' <<< ${COWPATH}) -type f | grep -Po '(?!\S+[/])[\w\-_]+[.]cow' | sed -e 's/[.]cow$//g' | sort -R | head -1;
- fi
- }
- motd ()
- {
- if [[ -x `which cowsay 2>/dev/null` ]] && [[ -x `which fortune 2>/dev/null` ]]; then
- if [[ -n ${COWPATH} ]]; then
- COWPATH=${COWPATH};
- local rc=$(random_cow);
- offensive | env cowsay -f ${rc};
- else
- local rc=$(random_cow);
- offensive | env cowsay -f ${rc};
- fi;
- fi
- }
- motd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement