LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-08-2014, 12:30 PM   #1
interndan
Member
 
Registered: Aug 2004
Location: near Marion, Ill
Distribution: Slackware 15 64bit on Desktop Slackwarearm on Raspberry PI v1b
Posts: 381

Rep: Reputation: 38
Question Where to put a script


Where should I put a script that needs to run after wireless network is established?
 
Old 05-08-2014, 12:47 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
this is what i do:
Code:
schneidz@xbmc:~$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

#/home/schneidz/bin/masq.ksh &
(sleep 45 && /usr/bin/sshfs schneidz@mom:media/stuff hyper) &> /dev/null &
else, maybe /etc/rc.local would be adequate ?
 
Old 05-08-2014, 12:50 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
If it is anything like Debian/Rhel, you can look up the wicd utilities, or networkmanager dispatch.d directory for running pre or post scripts.
 
Old 05-08-2014, 01:15 PM   #4
interndan
Member
 
Registered: Aug 2004
Location: near Marion, Ill
Distribution: Slackware 15 64bit on Desktop Slackwarearm on Raspberry PI v1b
Posts: 381

Original Poster
Rep: Reputation: 38
Thanks

I had forgotten about WICD pre/post script capabilities.
 
Old 05-08-2014, 01:55 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by szboardstretcher View Post
If it is anything like Debian/Rhel [...]
Are these threads cross-posted or something? This is on the Slackware forum, so, no, it isn't anything like Debian/Rhel.

---------- Post added 05-08-14 at 01:56 PM ----------

Quote:
Originally Posted by interndan View Post
Where should I put a script that needs to run after wireless network is established?
How are you establishing the network connection? /etc/rc.d/rc.inet1 or some other means?
 
Old 05-08-2014, 02:18 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
Quote:
Originally Posted by Richard Cranium View Post
Are these threads cross-posted or something? This is on the Slackware forum, so, no, it isn't anything like Debian/Rhel.
They are not.

Quote:
Originally Posted by interndan View Post
Thanks

I had forgotten about WICD pre/post script capabilities.
You are welcome.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Put each daily cron task in a separate script or put them all in one script? veeruk101 Linux - Newbie 4 10-19-2011 07:10 AM
Script out put to file s_linux SUSE / openSUSE 5 07-27-2009 02:17 PM
Where to put the wireless script? kushalkoolwal Debian 5 03-15-2009 05:40 PM
.. how to put a script to '/etc/rc.d/rc.*? emil+ Slackware 11 02-24-2006 02:27 PM
Bash put script jnusa Programming 3 09-07-2004 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration