For a quick hack on something like that just edit the script and make the second line (right after the #!/blah/blah) something like this:Calum wrote:like opera which will seemingly only run if run from within its directory
cd /path/to/opera
Code: Select all
#!/bin/bash
dir=`pwd`
cd /opt/opera;
./opera $dir/$1
exit 0
I see that you have solved it but what is the output when you do /etc/rc.d/rc.inet1 as a user?? I can execute it as a user in slack. But it could be that you just cant execute dhcpcd (which inet1 will call for dhcp) as a user.Calum wrote:yes, i am up and networking however i have another question, not network related, system related, but related to the issue at hand too:
when i boot the system with the machine's network interface card plugged into the gateway (if that's what i call it) it all works fab, and i am connected to the internet from go.
if i boot the computer when it is not plugged in, and then decide to connect to the Internet, the best way it looks like is to su to root and then run the startup script /etc/rc.d/rc.inet1 (this script listed above) which gets it all going right enough.
my question is this: how can i allow a normal user to run a simple command (say called "internet" or similar) without having to su to root, which will connect to the internet using all the right settings etc. Also, i imagine that running inet1 is not the best way to get the connection up and i wonder what the best method is.
Any ideas?
again, thanks beforehand.
is what i get, so what do you think?calum@claudia:~/downloads$ /etc/rc.d/rc.inet1
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCADDRT: Operation not permitted
Attempting to configure eth0 by contacting a DHCP server...
**** /sbin/dhcpcd: not a superuser
and from windows:calum@harvey ~ $ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.431 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=0.441 ms
64 bytes from 192.168.0.1: icmp_seq=12 ttl=64 time=0.438 ms
64 bytes from 192.168.0.1: icmp_seq=19 ttl=64 time=0.441 ms
64 bytes from 192.168.0.1: icmp_seq=24 ttl=64 time=0.445 ms
64 bytes from 192.168.0.1: icmp_seq=26 ttl=64 time=0.433 ms
64 bytes from 192.168.0.1: icmp_seq=45 ttl=64 time=0.447 ms
--- 192.168.0.1 ping statistics ---
47 packets transmitted, 7 received, 85% packet loss, time 46044ms
rtt min/avg/max/mdev = 0.431/0.439/0.447/0.020 ms
calum@harvey ~ $ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:01:02:18:20:13
inet addr:192.168.0.107 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:177 errors:0 dropped:0 overruns:1 frame:0
TX packets:344 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:49675 (48.5 KiB) TX bytes:48865 (47.7 KiB)
Interrupt:5 Base address:0xd800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1320 (1.2 KiB) TX bytes:1320 (1.2 KiB)
now i just *know* this is some simple config issue with how i have my network configured.C:\>ping 192.168.0.1
Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time<10ms TTL=64
Reply from 192.168.0.1: bytes=32 time<10ms TTL=64
Reply from 192.168.0.1: bytes=32 time<10ms TTL=64
Reply from 192.168.0.1: bytes=32 time<10ms TTL=64
Ping statistics for 192.168.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ifconfig
'ifconfig' is not recognized as an internal or external command,
operable program or batch file.
C:\>ipconfig
Windows 2000 IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.107
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
Code: Select all
calum@harvey ~ $ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
calum@harvey ~ $ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.394 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.362 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.365 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.363 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.364 ms
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms
rtt min/avg/max/mdev = 0.362/0.369/0.394/0.024 ms