From 5cdefe18a9aa8f6e41827468e6c2c89f1198eb83 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Wed, 8 Oct 2014 14:05:20 -0700 Subject: [PATCH] --- vpnsetup.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/vpnsetup.sh b/vpnsetup.sh index 32a3ac7..1d273a2 100644 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -5,14 +5,14 @@ # With minor modifications, this script *can also be used* on dedicated servers # or any KVM- or XEN-based Virtual Private Server (VPS) from other providers. # +# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN +# YOUR AMAZON EC2 INSTANCE STARTS! +# # For detailed instructions, please see: # https://blog.ls20.com/ipsec-l2tp-vpn-auto-setup-for-ubuntu-12-04-on-amazon-ec2/ # Original post by Thomas Sarlandie: # http://www.sarfata.org/posts/setting-up-an-amazon-vpn-server.md # -# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN -# YOUR AMAZON EC2 INSTANCE STARTS! -# # Copyright (C) 2014 Lin Song # Based on the work of Thomas Sarlandie (Copyright 2012) # @@ -22,11 +22,19 @@ # Attribution required: please include my name in any derivative and let me # know how you have improved it! +if [[ "`uname`" == "Darwin" ]]; then + echo "Do not run this script on your mac! This script should only be run on a newly-created EC2 instance, after you have modified it to set the three variables below." + exit 1 +fi + # Please define your own values for those variables IPSEC_PSK=your_very_secure_key VPN_USER=your_username VPN_PASSWORD=your_very_secure_password +# Note: If you need multiple VPN users with different credentials, +# please see: https://gist.github.com/hwdsl2/123b886f29f4c689f531 + # Install necessary packages apt-get update apt-get install libnss3-dev libnspr4-dev pkg-config libpam0g-dev \ @@ -130,9 +138,6 @@ lcp-echo-interval 60 connect-delay 5000 EOF -# If you need multiple VPN users with different credentials, -# please see: https://gist.github.com/hwdsl2/123b886f29f4c689f531 - cat > /etc/ppp/chap-secrets <