Linux Bash script on archlinuxarm

distro

Level E
I am using archlinuxarm on pogoplug.
I am trying to use a script which will start my vpn-pptp script.
The command for vpn starting is "pon tunnel" ; where tunnel is the name of the pptp script.
My script is to start "pon tunnel" on boot:
Code:
#!/bin/bash
pon vpnbook

I have saved the script as tunnel.sh and I have done chmod+x on it.
I have made a cron job to start the script at reboot.

I see the command "pon tunnel" is not executed on reboot. If i just do "pon tunnel" on prompt, then the vpn connects to the server.

Any ideas on this ?
 
if you add it to ~/.bashrc it will be executed when ever you login. if you want it to run wether a user is logged in or not, then you have to write an init script and place it in /etc/init.d and run as a service using chkconfig.
 
theres no init.d folder under arch, instead theres rc.d and heres the script , not working
Code:
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

DAEMON=tunnel
ARGS=

[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON


case "$1" in
 start)
   stat_busy "Starting $DAEMON"
   pon tunnel updetach persist &>/dev/null
   if [ $? = 0 ]; then
     add_daemon $DAEMON
     stat_done
   else
     stat_fail
     exit 1
   fi
   ;;
 stop)
   stat_busy "Stopping $DAEMON"
   poff tunnel &>/dev/null
   if [ $? = 0 ]; then
     rm_daemon $DAEMON
     stat_done
   else
     stat_fail
     exit 1
   fi
   ;;
 restart)
   $0 stop
   sleep 1
   $0 start
   ;;
 *)
   echo "usage: $0 {start|stop|restart}"  
esac

it isnt working with this script, any corrections ?
 
No chkconfig for archlinux.
Under arch, daemon must be in /etc/rc.d and entry made in rc.conf

Is my initial bash script wrong ?
 
Is the Crontab entry "@reboot /root/tunnel.sh" correct ?

rc.local is a file. How to put it in rc.local ? In rc.local should I use Crontab entry command Or the script ?
 
The VPN doesn't connects if it's done on boot up, even with /usr/bin/sleep command. Tried till 300 seconds after boot so that pogo has the ip and znc is running and well connected. But no use.

If I run the same job manually, it connects easily.

Any one connecting and reconnecting on auto to VPN server ?
 
Yes, perfectly.
To add to it, the commands get executed, that is cron job is working but the VPN doesn't connects. I don't have errors under log. Just "modem hang up"
 
- - - Updated - - -

Got it working :)

I made a systemd command for openvpn and edited it for my pptp commands. now, it connects fine on boot followed with znc.
 
I'm confused here if you only need to connect to IRC Channel which znc does or you are saying you run IRC server on your pogo ?
 
Back
Top