Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
post your /etc/issue
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
sapphirecat
Guru
Guru


Joined: 15 Jan 2003
Posts: 376

PostPosted: Sun Jun 13, 2004 1:14 pm    Post subject: Reply with quote

Satori80 wrote:
What I can't figure is where is it documented what all the control sequences are? Where are they listed?

man agetty, ISSUE ESCAPES section.
_________________
Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%...
Back to top
View user's profile Send private message
gnuageux
Veteran
Veteran


Joined: 17 Apr 2004
Posts: 1201

PostPosted: Fri Jul 02, 2004 12:20 pm    Post subject: Reply with quote

This is \n.\O (\s \m \r) \t

linux_logo -l 1

Linux Version 2.4.20-gentoo-r6, Compiled #1 Thu Feb 19 01:39:20 MST 2004
One 550MHz Intel Pentium III Processor, 384M RAM, 1094.45 Bogomips Total
K-Mart
_________________
The realOTW: http://forums.realotw.org/index.php

Registered Linux user#364538
Back to top
View user's profile Send private message
beltazore
Apprentice
Apprentice


Joined: 30 Oct 2003
Posts: 174
Location: Norway

PostPosted: Sun Mar 13, 2005 2:33 pm    Post subject: Show me your /etc/issue Reply with quote

Well, I could not find a topic like this on the forum. Correcte me if im wrong.

Here are my /etc/issue
Code:

Hostname: \n
OS: Gentoo \s
Kernel: \r
Processor: \m
Memory: 516220 kB
Terminal: \l


Now, show me yours!
Back to top
View user's profile Send private message
John5788
Advocate
Advocate


Joined: 06 Apr 2004
Posts: 2101
Location: 127.0.0.1

PostPosted: Sun Mar 13, 2005 4:09 pm    Post subject: Reply with quote

[/home/john5788 :: 08:09 AM :: 2]
[john5788@john5788.x5788.net] $ cat /etc/issue

This is \n.\O (\s \m \r) \t
_________________
John5788
Back to top
View user's profile Send private message
Xemoka
n00b
n00b


Joined: 08 Jul 2004
Posts: 32
Location: BC, Canada

PostPosted: Sun Mar 13, 2005 7:38 pm    Post subject: Reply with quote

Code:

 _______ ______                    _       
(_______|______)                  (_)     
    _    _     _ _____  ____ _ _ _ _ ____ 
   | |  | |   | (____ |/ ___) | | | |  _ \
   | |  | |__/ // ___ | |   | | | | | | | |
   |_|  |_____/  \_____|_|     \___/|_|_| |_|
                                           
Hostname:  \n
OS:        Gentoo \s
Kernel:    \r
Processor: \m
Memory:    396 mB
Terminal:  \l


Odly Enough, that comes out perfectly clear on my consoles...... odd
_________________
#gentoo-glbt
Spend a little time and answer a few questions!
Learn how to Properly emerge ~arch
Back to top
View user's profile Send private message
-Rick-
Tux's lil' helper
Tux's lil' helper


Joined: 29 Aug 2004
Posts: 77
Location: Holland

PostPosted: Sun Mar 13, 2005 7:44 pm    Post subject: Reply with quote

Whats this file for?

Code:

rick@rick-ubuntu:~ $ cat /etc/issue
Ubuntu 4.10 "Warty Warthog" \n \l

_________________
Cube bots
Nixstaller - Easy creatable installers for *nix
Back to top
View user's profile Send private message
beltazore
Apprentice
Apprentice


Joined: 30 Oct 2003
Posts: 174
Location: Norway

PostPosted: Sun Mar 13, 2005 7:54 pm    Post subject: Reply with quote

You just showed us that you are using Ubuntu :P

Its the text over you login @ console
Back to top
View user's profile Send private message
-Rick-
Tux's lil' helper
Tux's lil' helper


Joined: 29 Aug 2004
Posts: 77
Location: Holland

PostPosted: Sun Mar 13, 2005 8:42 pm    Post subject: Reply with quote

beltazore wrote:
You just showed us that you are using Ubuntu :P

Its the text over you login @ console

I see...
Ya using ubuntu here, laptop has still gentoo :)
_________________
Cube bots
Nixstaller - Easy creatable installers for *nix
Back to top
View user's profile Send private message
mascanho
Veteran
Veteran


Joined: 21 Dec 2004
Posts: 1241
Location: On my Bmx Bike on a Concrete Park Flatlanding ...

PostPosted: Mon Mar 14, 2005 12:29 am    Post subject: Reply with quote

Guys just emerge figlet and cowsay and use your imagination :P
_________________
Flatland Life is a Choice !
emerge avatar
Back to top
View user's profile Send private message
antik
Apprentice
Apprentice


Joined: 01 Oct 2002
Posts: 212

PostPosted: Mon Mar 14, 2005 12:40 am    Post subject: Re: Show me your /etc/issue Reply with quote

beltazore wrote:
Well, I could not find a topic like this on the forum. Correcte me if im wrong.
Now, show me yours!


Code:
# cat /etc/issue
cat: /etc/issue: No such file or directory


Code:
# cat /etc/motd
FreeBSD 5.4-PRERELEASE (MADRID2) #1: Wed Mar  9 17:14:17 EET 2005

Welcome to FreeBSD!

Before seeking technical support, please use the following resources:

o  Security advisories and updated errata information for all releases are
   at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
   for your release first as it's updated frequently.

o  The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
   along with the mailing lists, can be searched by going to
   http://www.FreeBSD.org/search/.  If the doc distribution has
   been installed, they're also available formatted in /usr/share/doc.

If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man'.

You may also use sysinstall(8) to re-enter the installation and
configuration utility.  Edit /etc/motd to change this login announcement.

_________________
"Yes, I know Linux runs faster, but they can do that because they have thrown out the weight of the airbag, collision frame and safety belt." —Poul-Henning Kamp
Back to top
View user's profile Send private message
shazow
Apprentice
Apprentice


Joined: 11 Dec 2003
Posts: 176
Location: Canada, Ontario

PostPosted: Sun Apr 10, 2005 5:26 am    Post subject: Reply with quote

I wrote a slightly modified version of ecatmur's randomized colourized cow + fortune message thingie.

What's different?
- Choose your cow colour as well as text colour. (Random by default)
- Choose between cowthink and cowsay. (Random by default)
- Cleaned it up a bit, fixed some spacing issues.
- Commented, made easier for editing.

And, I kept with the Canadian theme for variable naming, as homage to my fellow Canadian. ;-)

Here it is:
Code:
#!/bin/bash

if [ -x "$(which cowsay)" ]; then
        # Randomize the cow goodness
        cows=(/usr/share/cowsay*/cows/*.cow)  # What kind of cow am I?
        modes=("-b" "-d" "-g" "-s" "-t" "-w" "-y" "")   # What's my mood?
        speakers=("cowsay" "cowthink")  # To think or to speak?
        filter="${speakers[$(($RANDOM%2))]} -f ${cows[$(($RANDOM%${#cows}))]} ${modes[$(($RANDOM%8))]} -n"
        # Update: Changed '${#modes}' to '8'. The former appears to give "2" for some reason.
else
        filter="cat"  # Meow
fi

normal=$'\x1b[0;0m'

colours=($'\x1b[30;01m' $'\x1b[31;01m' $'\x1b[32;01m' $'\x1b[33;01m' $'\x1b[34;01m' $'\x1b[35;01m' $'\x1b[36;01m' $'\x1b[0;0m')
# (Incase you want to use a constant, here are the index values:)
# 0 = gray
# 1 = red
# 2 = green
# 3 = yellow
# 4 = blue
# 5 = purple
# 6 = teal
# 7 = white
# Example: producer_colour=${colours[1]}

producer_colour=${colours[$(($RANDOM%8))]} 
filter_colour=${colours[$(($RANDOM%8))]}


# Mark start and end points of each producer string (eg. fortune)
markproducer () {
   sed "s/^/¹/;s/$/²/";
}

# Mark start and end points of filter string (eg. cow)
markfilter() {
   sed "s/^/¯/;s/$/°/";
}

# Colourize the producer (inner message, eg. fortune)
colourproducer () { 
   sed "s/¹/ $filter_colour/;s/²/$producer_colour /";
}

# Colourize the rest (outer filter, eg. cow)
colourfilter () {
   sed "s/¯/$producer_colour/;s/°/$normal/";
}

# Check if we have fortune
if [ -x "$(which fortune)" ]; then
        producer="fortune -a" # All fortunes
else
        producer="uname -a"
fi

# Output result
$producer | markproducer | $filter | markfilter | colourfilter | colourproducer


This will output it to your terminal. If you want, you can route it to where ever you like, such as /etc/motd.

I hope ecatmur doesn't mind. I edited it for my own use, but then I figured I'd let everyone else benefit. :-)
Plus, I learned how to use sed along the way, so everybody wins.

Enjoy,
- shazow


Last edited by shazow on Mon Apr 11, 2005 4:33 am; edited 1 time in total
Back to top
View user's profile Send private message
netron
n00b
n00b


Joined: 02 Aug 2004
Posts: 11

PostPosted: Sun Apr 10, 2005 10:03 am    Post subject: Reply with quote

Code:

(0)[netron@holz:~]% cat /etc/issue
























(0)[netron@holz:~]%
Back to top
View user's profile Send private message
russianpirate
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1167
Location: Detroit, MI

PostPosted: Mon Jun 13, 2005 6:52 am    Post subject: /etc/issue customizing Reply with quote

heres mine right now:
Code:

^[[0;34;40m                              ^[[0;31;40m
^[[0;34;40m DDD      A     RRRRR   K  K  ^[[0;31;40m SS   TTTTT     A      RRRRR^[[0;34;40m D  D   A   A   R   R   K K   ^[[0;31;40mS       T     A   A    R   R^[[0;34;40m D  D   AAAAA   RRRR    KK    ^[[0;31;40m S      T     AAAAA    RRRR
^[[0;34;40m D  D   A   A   R   R   K K   ^[[0;31;40m   S    T     A   A    R   R^[[0;34;40m DDD    A   A   R   R   K  K  ^[[0;31;40m SS     T     A   A    R   R
^[[0;38;40m Machine: \n (\s \m \r)
^[[0;38;40m Time:    \t
^[[0;37;40m


^^ some code went multiple lines, but in real its all single lines

which produces:
Code:

 DDD      A     RRRRR   K  K   SS   TTTTT     A      RRRRR
 D  D   A   A   R   R   K K   S       T     A   A    R   R
 D  D   AAAAA   RRRR    KK     S      T     AAAAA    RRRR
 D  D   A   A   R   R   K K      S    T     A   A    R   R
 DDD    A   A   R   R   K  K   SS     T     A   A    R   R

 Machine: darkstar (Linux i686 2.6.11-gentoo-r9)
 Time:    (curent time)

(with word dark in blue and star in red)

are there any more variables i can add
wats the cpu/bogomips variable
and maybe how much ram i have..
Back to top
View user's profile Send private message
russianpirate
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1167
Location: Detroit, MI

PostPosted: Tue Jun 14, 2005 3:08 am    Post subject: Reply with quote

noone pimps out their issue file? omg :P
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2138
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Jun 14, 2005 8:40 am    Post subject: Reply with quote

awright, I'll bite:

Code:

                ...
              ;::::;
            ;::::; :;
          ;:::::'   :;
         ;:::::;     ;.
        ,:::::'       ;           OOO\
        ::::::;       ;          OOOOO\
        ;:::::;       ;         OOOOOOOO
       ,;::::::;     ;'         / OOOOOOO
     ;:::::::::`. ,,,;.        /  / DOOOOOO
   .';:::::::::::::::::;,     /  /     DOOOO
  ,::::::;::::::;;;;::::;,   /  /        DOOO
 ;`::::::`'::::::;;;::::: ,#/  /          DOOO
 :`:::::::`;::::::;;::: ;::#  /            DOOO
 ::`:::::::`;:::::::: ;::::# /              DOO
 `:`:::::::`;:::::: ;::::::#/               DOO
  :::`:::::::`;; ;:::::::::##                OO
  ::::`:::::::`;::::::::;:::#                OO
  `:::::`::::::::::::;'`:;::#                O
   `:::::`::::::::;' /  / `:#
    ::::::`:::::;'  /  /   `#

et haec erit plaga qua percutiet Dominus omnes gentes quae pugnaverunt
adversus Hierusalem tabescet caro uniuscuiusque stantis super pedes suos
et oculi eius contabescent in foraminibus suis et lingua eorum contabescet
in ore suo                                    --  Zec 14:12

scourge login:


_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
russianpirate
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1167
Location: Detroit, MI

PostPosted: Tue Jun 14, 2005 5:30 pm    Post subject: Reply with quote

I was mostly asking on what variables (more info) i could add, like RAM size/ HD, etc.

How can i make an output of a program show up in issue (fortune)?
Back to top
View user's profile Send private message
Mnemia
Guru
Guru


Joined: 17 May 2002
Posts: 476

PostPosted: Tue Jun 14, 2005 5:36 pm    Post subject: Reply with quote

russianpirate wrote:
I was mostly asking on what variables (more info) i could add, like RAM size/ HD, etc.

How can i make an output of a program show up in issue (fortune)?


This is a script I use, adapted from a forum posting a long time ago (several years). It will display the fortune stuff in your /etc/issue and change it every time you reboot. Just save this into a file in /etc/init.d/, and add it to your autoboot in the same way you do other scripts in there. You can easily change it to add whatever other info you want which it can derive from any runnable program.

Code:

#!/sbin/runscript
#Local system initialization script

depend() {
        need localmount
}

checkconfig() {
        return 0;
}

start() {
        ebegin "Initializing MOTD display"
        checkconfig || return $?

        RELEASE="release 2005.0"
        COLOR1="\033[1;6m\033[35;40m"
        COLOR2="\033[1;6m\033[37;40m"
        COLOR3="\033[1;6m\033[39;40m"
        COLOR_RESET="\033[0m"

        /usr/bin/clear >> /etc/issue
        echo -e $COLOR1"Gentoo"$COLOR2 "Linux "$COLOR_RESET"$RELEASE""(\l)">>/etc/issue        echo "Kernel $(uname -r) on an $(uname -m)" >> /etc/issue
        echo -e $COLOR3"Fortune of the day:">>/etc/issue
        fortune >> /etc/issue
        #echo >> /etc/issue
        cp -f /etc/issue /etc/issue.net

        eend $? "Failed to start MOTD display"
}

stop()
{
        ebegin "Stopping MOTD display"

        rm -f /etc/issue
        rm -f /etc/issue.net

        eend $? "Failed to stop MOTD display"
}


Last edited by Mnemia on Tue Jun 14, 2005 5:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2138
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Jun 14, 2005 5:37 pm    Post subject: Reply with quote

russianpirate wrote:
I was mostly asking on what variables (more info) i could add, like RAM size/ HD, etc.
man getty :)

russianpirate wrote:
How can i make an output of a program show up in issue (fortune)?

write a cron script to build a new issue file every $TIME_UNIT.

like

cat /etc/issue.head > /tmp/issue.tmp
echo -e "\n\n >> /tmp/issue.tmp
fortune -aos >> /tmp/issue.tmp
echo -e "\n\n >> /tmp/issue.tmp
cat /etc/issue.tail >> /tmp/issue.tmp
mv /tmp/issue.tmp /etc/issue
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
russianpirate
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1167
Location: Detroit, MI

PostPosted: Tue Jun 14, 2005 5:40 pm    Post subject: Reply with quote

how about a random one everytime.. like it runs when issue is scanned (all random ones on every tty)... this is probly impossible

i dont have getty
Code:
darkstar ~ # man getty
No manual entry for getty
Back to top
View user's profile Send private message
Mnemia
Guru
Guru


Joined: 17 May 2002
Posts: 476

PostPosted: Tue Jun 14, 2005 5:44 pm    Post subject: Reply with quote

Try
Code:

man agetty

instead,
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2138
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Jun 14, 2005 5:48 pm    Post subject: Reply with quote

russianpirate wrote:
how about a random one everytime.. like it runs when issue is scanned (all random ones on every tty)... this is probly impossible

Not possible like this (I hear you could do that in GNU HURD as they have something like "filesystem triggers" that let you execute something on read. But I might be misinformed there.)

However you could set up a cron job to generate a new one every 5 secs or so.

I guess another slightly more hackish solution would be making /etc/issue a FIFO and letting a (perl?) script constantly output something to it. Is a bit too fragile for my taste though, you usually really don't want to break getty/login.

russianpirate wrote:
i dont have getty
Code:
darkstar ~ # man getty
No manual entry for getty

Try "man agetty" then :)
_________________
Please put [SOLVED] in your topic if you are a moron.


Last edited by nephros on Tue Jun 14, 2005 5:52 pm; edited 2 times in total
Back to top
View user's profile Send private message
russianpirate
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1167
Location: Detroit, MI

PostPosted: Tue Jun 14, 2005 5:50 pm    Post subject: Reply with quote

wouldnt that waste a lot of cpu every 5 secs?
in red hat, when you login you get a random one, but i think thats in init script of bash
ill just skip fortune
Back to top
View user's profile Send private message
Mnemia
Guru
Guru


Joined: 17 May 2002
Posts: 476

PostPosted: Tue Jun 14, 2005 6:02 pm    Post subject: Reply with quote

Might it be possible to setup agetty to point to a script instead of just /bin/login? Then the script could replace /etc/issue first and then run the normal login...
Back to top
View user's profile Send private message
russianpirate
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1167
Location: Detroit, MI

PostPosted: Tue Jun 14, 2005 8:08 pm    Post subject: Reply with quote

nice idea.. but i dont wanna screw tty up.. u know any way to do it safely?
Back to top
View user's profile Send private message
stustill
Guru
Guru


Joined: 25 Feb 2003
Posts: 333
Location: Aberdeen, Scotland

PostPosted: Tue Jun 14, 2005 11:42 pm    Post subject: Reply with quote

If you are wanting to display a message at each login, why not just put an entry into the users .bashrc? If you wanted everyone who uses the system to get a fortune popping up, just put add fortune to the /etc/skel/.bashrc. This also means users can choose not to get a fortune by removing the line in .bashrc.

Check here for details of /etc/issue variables.

Stu
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum