3 # this program is run in the background to show a bye message on the console.
5 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
7 export LIGHTWEIGHT_INIT=true # make sure we just get our variables.
8 source $HOME/yeti/scripts/launch_feisty_meow.sh
9 export host=$(hostname)
11 # use this to always print the message.
12 # export hostlist=$host
14 # only print on a few...
15 export hostlist='chandra ducky equanimity gulliver hamstergate \
16 mycroft mrowrt numenor shaggy simmy slowboat velma wolfe \
18 dervish frylock lagomorph shakezula '
19 #hmmm: this hostlist is highly dependent on my own favorite host names.
20 # to commoditize this, we should instead use a config file for the list.
22 # set our domain name based on what's found in the resolv.conf file, where
23 # dns info is often found.
24 DOMAIN_NAME=$(grep -i search </etc/resolv.conf | tail -1 | sed -n -e 's/domain.\(.*\)$/\1/p')
25 if [ -z "$DOMAIN_NAME" ]; then
26 # second try, searching out the search domain as a suitable replacement
27 # for the actual domain being specified.
28 DOMAIN_NAME=$(grep -i search </etc/resolv.conf | tail -1 | sed -n -e 's/search.\(.*\)$/\1/p')
30 # oh well, we don't know what the heck the domain is.
31 if [ -z "$DOMAIN_NAME" ]; then DOMAIN_NAME=unknown_domain; fi
33 echo domain is $DOMAIN_NAME
35 for i in $hostlist; do
36 if [ "$host" = "$i" -o "$host" = "$i.$DOMAIN_NAME" ]; then
37 # echo $(date_stringer)": $host matched." >>$HOME/host_matched_in_byejob.txt
39 sleep 7; bash $FEISTY_MEOW_SCRIPTS/users/byemessage.sh /dev/console