SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am extremely confused. I have tried alot of different things and have gotten close a few times, but still no luck.
Normally I have to manually type this after I login. (I only have root acc)
But I want this to happen automatically. Now would someone please explain/guide me how to do this.
And please remember it has to be executed AFTER I get past the login screen where I type root + password or else it wont work.
Thank you very much!
Thank you very much! Now how do I add the probe and macchange commands to:
(Please guide me :b)
Code:
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.
# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man
export HOSTNAME="`cat /etc/HOSTNAME`"
export LESSOPEN="|lesspipe.sh %s"
export LESS="-M"
# If the user doesn't have a .inputrc, use the one in /etc.
if [ ! -r "$HOME/.inputrc" ]; then
export INPUTRC=/etc/inputrc
fi
# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/apache/bin:/usr/local/pgsql/bin:/opt/mono/bin:/usr/local/pgsql/bin:/opt/nessus/bin:."
# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
# the $PATH. Some means of connection don't add these by default (sshd comes
# to mind).
if [ "`id -u`" = "0" ]; then
echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
if [ ! $? = 0 ]; then
PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
fi
fi
# I had problems using 'eval tset' instead of 'TERM=', but you might want to
# try it anyway. I think with the right /etc/termcap it would work great.
# eval `tset -sQ "$TERM"`
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
TERM=linux
fi
# Set ksh93 visual editing mode:
if [ "$SHELL" = "/bin/ksh" ]; then
VISUAL=emacs
# VISUAL=gmacs
# VISUAL=vi
fi
# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
if [ "$SHELL" = "/bin/pdksh" ]; then
PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
PS1='! ${PWD/#$HOME/~}$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
PS1='$ '
else
#My colour additions (muts)
#PS1="\u@\h:\w\$ "
#PS1="\[\033[1;34m\]\u@\h:\w\$ \033[0m "
#PS1='\[\e[34;1m\]\u@\h:\w\$ \[\e[0m\]'
PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
fi
PS2='> '
export PATH DISPLAY LESS TERM PS1 PS2
# Default umask. A umask of 022 prevents new files from being created group
# and world writable.
umask 022
# Set up the LS_COLORS and LS_OPTIONS environment variables for color ls:
if [ "$SHELL" = "/bin/zsh" ]; then
eval `dircolors -z`
elif [ "$SHELL" = "/bin/ash" ]; then
eval `dircolors -s`
else
eval `dircolors -b`
fi
# Notify user of incoming mail. This can be overridden in the user's
# local startup file (~/.bash.login or whatever, depending on the shell)
if [ -x /usr/bin/biff ]; then
biff y
fi
# Append any additional sh scripts found in /etc/profile.d/:
for profile_script in /etc/profile.d/*.sh ; do
if [ -x $profile_script ]; then
. $profile_script
fi
done
unset profile_script
# For non-root users, add the current directory to the search path:
if [ ! "`id -u`" = "0" ]; then
PATH="$PATH:."
fi
You may be better off putting those commands in your rc.local file (usually in /etc/init.d/ or /etc/rc.d/ or /etc/rc.d/init.d), so that they get run at every boot.
The .profile file is a script that runs each time you log in; rc.local runs each time the machine boots up, just before the login prompt.
In either case, the script is written in a shell programming language (usually bash), which is basically the same as the language you use to type in to your text console. So you should be able to add these lines to the end of the file.
You can either do this with a text editor, or from the shell:
And please remember it has to be executed AFTER I get past the login screen where I type root + password or else it wont work.
I tried doing that, the modprobe ndiswrapper worked perfectly but the macchange did not. The macchange has to be executed somehow after login.
Any ideas?
Have you tried using the full path of the macchanger program (I.e. /usr/sbin/macchanger ...)?
There we go ! Now it works perfectly . One last thing, I can now see the output of macchanger at the top of my login screen. Anyway to make it invisible so macchanger does its job in the background?
little bumper, I added a few other commands to the rc.d file and now I got a pretty long output on my login screen and it is pretty annoying. So how do I make these scripts run in background?
You're talking about two very different things here. To background a process, you add an '&' after the command, this effectively 'daemon'-izes the process, but it will still dump all output to the screen 'stdout'. I don't think this is what you were talking about, was it ? What you might want is to redirect output to something other than 'stdout'. To do this you can add either '1> file' for redirecting stdout, '2> file' for stderr (errors) or ' 1> file 2>&1' for both after the command, where 'file' can be any file including '/dev/null' the 'black hole'
Examples:
Code:
# background a process
command &
# redirect program stdout output to 'file'
command 1> file
# redirect program stderr output to 'file'
command 2> file
# redirect all program output to 'file'
command 1> file 2>&1
Also note:
0 = stdin
1 = stdout
2 = stderr
And remember, try not to use terms you don't fully understand, just describe what you want to do.
Last edited by H_TeXMeX_H; 10-25-2007 at 10:21 AM.
Oh yeah, I formulated myself incorrect there. Making a script run in
background could be understood that it is running all the time. Well what
I meant was just the output had to be invisible. Well despite that, you
gave me the answer I needed - so thank you very much
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.