Q. I am using Fedora Core Linux. How do I run a script called /etc/rapp/logtime.sh immediately after my ppp interface is up?
A. Point-to-Point Protocol (PPP), is data link protocol commonly used for dial-up internet access. It is used to establish a direct connection between two nodes. It can connect computers using serial cable, phone line, trunk line, cellular telephone, specialized radio links, or fiber optic links. Most Internet service providers use PPP for customers' dial-up access to the Internet.
Fedora Core - /etc/ppp/ip-up.local file
Under Fedora Core / RHEL /CentOS Linux you need to create or edit file - /etc/ppp/ip-up.local (Debian / Ubuntu Linux user see below for more information).
There is also a file called /etc/ppp/ip-up and it should not be modified -- make local all changes to /etc/ppp/ip-up.local file only.
Step # 1: Open /etc/ppp/ip-up.local file
# vi /etc/ppp/ip-up.local
Step # 2: You can call your shell script - /etc/rapp/logtime.sh or any other program from this file by adding following line:
Save and close the file.
Step # 3: Set executable permission
Next set the file executable for the owner:
# chmod 700 /etc/ppp/ip-up.local
Then set the file executable for script - /etc/rapp/logtime.sh
# chmod +x /etc/rapp/logtime.sh
From now on, the file /etc/ppp/ip-up.local will be executed immediately after the ppp0 interface has been brought up by your dialer.
Debian / Ubuntu Linux
Under Debian / Ubuntu Linux put your script in /etc/ppp/ip-up.d/ directory itself. /etc/ppp/ip-up script is run by the pppd after the link is established. It uses run-parts to run scripts in /etc/ppp/ip-up.d you should create script(s) there.
# cp /etc/rapp/logtime.sh /etc/ppp/ip-up.d/
# chmod +x /etc/ppp/ip-up.d/logtime.sh
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop