ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello all, I have a problem with a script which came as part of a book example, the first line of the script after the #!/bin/sh line is simply this: SSH_DIR=/opt/ssh-dir, the directory exists and is readable by everyone, however when I run the script I receive this error: "SSH_DIR is a directory" the script then terminates, any ideas what this might be ??
if [ "$client_debug" = "yes" ] ; then
set -x
client_pppd_args="$client_pppd_args debug"
fi
}
run_as_sshvpn () {
whoami=`$WHOAMI`
pwd=`pwd`
case "$whoami" in
root) exec $SU - $SSH_VPN_USER "-ccd $pwd;$0 $*";
exit 0; ;;
$SSH_VPN_USER) ;;
*) echo "$0 Must be run as $SSH_VPN_USER" >&2;
exit 1; ;;
esac
}
# Determine how we should behave:
if [ ! -z "$LINKNAME" ] ; then
# We were called as the ip-up script from pppd
vpn_config $LINKNAME
# Configure our new route
# sudo not needed -- we were run from pppd as root
# $IPREMOTE is set by pppd for us
[ "$server_network" ] && $ROUTE add -net $server_network gw $IPREMOTE
exit 0;
elif [ "$1" = "stop" ] ; then
# We were invoked init.d style, as one of the following:
# /etc/init.d/vpn-client stop vpn1
# /etc/init.d/vpn1 stop
# /etc/rcX.d/S##vpnname stop
I think the error comes from this line. Try to insert before and after a line like: echo "before error" and echo "after error" to know if I'm right If I'm right, we need to know more about ccd option to debug it
Hello all, sorry for the delay in posting ( damn work !) the problem turned out to be blank lines at the end of the conf file, which is read on this line
# Grab global variables
. $SSH_VPN_DIR/etc/ssh-vpn.conf || exit 0
I have another problem now which is ppp authentication, but that's another story
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.