Hi there.
I have some problems with rc.local. It wont execute a scipt of mine at startup.
The script itself works and if I run rc.local manually it works too...
The script to run:
#!/bin/sh
# Getting your external IP-adress from
http://whatismyip.org/
set `lynx -dump http://whatismyip.org/`
IP=$1
# Specify the following options
# Senders email:
SendersEmail="mymail@hotmail.com"
# Senders usernamne:
Username="mymail@hotmail.com"
# Senders password:
Password="mypassword"
# Recievers email:
RecieversEmail="myothermail@hotmail.com"
# Subject:
Subject="IP-adress"
# Message:
Message="$IP"
# SMTP Server:
Server="smtp.live.com:587"
# Sending the email
sendEmail -f $SendersEmail \
-t $RecieversEmail \
-s $Server \
-xu $Username \
-xp $Password \
-u $Subject \
-m $Message
/etc/rc.d/rc.local:
[root@Rorschach rc.d]# cat rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
./sendIPmail.sh
[root@Rorschach rc.d]#
Doesn't seem to be a lynx-issue. I've tried with hard coded text as message too...
The script lies under / and have chmod 777.
Any ideas?
Running CentOS 5.5
(if you didn't get it, this script is for sending the external IP-adress to my email att startup. If a thief is stupid enough to start it connected to internet)