checkserver fix (for using systemctl); install.sh small refactoring; openvpn some dists bugfix (systemctl with full config name)
This commit is contained in:
parent
d95f1d351a
commit
f2e6b6728d
@ -3,11 +3,11 @@
|
|||||||
RET=$(pgrep xl2tpd)
|
RET=$(pgrep xl2tpd)
|
||||||
|
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
/etc/init.d/xl2tpd restart
|
systemctl restart xl2tpd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RET=$(pgrep starter)
|
RET=$(pgrep starter)
|
||||||
|
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
/etc/init.d/strongswan restart
|
systemctl restart strongswan
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -10,7 +10,7 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing strongSwan and xl2tp server..."
|
echo "Installing strongSwan and xl2tp server..."
|
||||||
apt-get install strongswan xl2tpd cron iptables procps
|
apt-get -y install strongswan xl2tpd cron iptables procps net-tools
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Configuring routing..."
|
echo "Configuring routing..."
|
||||||
@ -39,15 +39,15 @@ echo
|
|||||||
echo "Configuring PSK..."
|
echo "Configuring PSK..."
|
||||||
$DIR/psk.sh
|
$DIR/psk.sh
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Configuring VPN users..."
|
|
||||||
$DIR/adduser.sh
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Adding cron jobs..."
|
echo "Adding cron jobs..."
|
||||||
yes | cp -rf $DIR/checkserver.sh $CHECKSERVER
|
yes | cp -rf $DIR/checkserver.sh $CHECKSERVER
|
||||||
$DIR/autostart.sh
|
$DIR/autostart.sh
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Configuring VPN users..."
|
||||||
|
$DIR/adduser.sh
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Starting strongSwan and xl2tp..."
|
echo "Starting strongSwan and xl2tp..."
|
||||||
service xl2tpd restart
|
service xl2tpd restart
|
||||||
|
|||||||
@ -3,5 +3,5 @@
|
|||||||
RET=$(pgrep openvpn)
|
RET=$(pgrep openvpn)
|
||||||
|
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
/etc/init.d/openvpn restart
|
systemctl restart openvpn@openvpn-server
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -12,7 +12,7 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing OpenVPN..."
|
echo "Installing OpenVPN..."
|
||||||
apt-get install openvpn easy-rsa cron iptables procps
|
apt-get -y install openvpn easy-rsa cron iptables procps net-tools
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Configuring routing..."
|
echo "Configuring routing..."
|
||||||
@ -34,6 +34,10 @@ echo
|
|||||||
echo "Configuring DNS parameters..."
|
echo "Configuring DNS parameters..."
|
||||||
$DIR/dns.sh
|
$DIR/dns.sh
|
||||||
|
|
||||||
|
# workaround: Debian's openssl version is not compatible with easy-rsa
|
||||||
|
# using openssl-1.0.0.cnf if openssl.cnf not exists
|
||||||
|
cp -n /etc/openvpn/easy-rsa/openssl-1.0.0.cnf /etc/openvpn/easy-rsa/openssl.cnf
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Creating server keys..."
|
echo "Creating server keys..."
|
||||||
make-cadir $CADIR
|
make-cadir $CADIR
|
||||||
@ -45,21 +49,21 @@ source ./vars
|
|||||||
./build-dh
|
./build-dh
|
||||||
openvpn --genkey --secret ta.key
|
openvpn --genkey --secret ta.key
|
||||||
|
|
||||||
cd $STARTDIR
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Configuring VPN users..."
|
|
||||||
$DIR/adduser.sh
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Adding cron jobs..."
|
echo "Adding cron jobs..."
|
||||||
yes | cp -rf $DIR/checkserver.sh $CHECKSERVER
|
yes | cp -rf $DIR/checkserver.sh $CHECKSERVER
|
||||||
$DIR/autostart.sh
|
$DIR/autostart.sh
|
||||||
|
|
||||||
|
cd $STARTDIR
|
||||||
|
echo
|
||||||
|
echo "Configuring VPN users..."
|
||||||
|
$DIR/adduser.sh
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Starting OpenVPN..."
|
echo "Starting OpenVPN..."
|
||||||
systemctl enable openvpn
|
systemctl -f enable openvpn@openvpn-server
|
||||||
service openvpn restart
|
systemctl restart openvpn@openvpn-server
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installation script completed!"
|
echo "Installation script completed!"
|
||||||
|
|||||||
@ -3,5 +3,5 @@
|
|||||||
RET=$(pgrep pptpd)
|
RET=$(pgrep pptpd)
|
||||||
|
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
/etc/init.d/pptpd restart
|
systemctl restart pptpd
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -10,15 +10,11 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing PPTP server..."
|
echo "Installing PPTP server..."
|
||||||
apt-get install pptpd cron iptables procps
|
apt-get -y install pptpd cron iptables procps net-tools
|
||||||
|
|
||||||
ADDUSER="no"
|
ADDUSER="no"
|
||||||
ANSUSER="yes"
|
ANSUSER="yes"
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Configuring VPN users..."
|
|
||||||
$DIR/adduser.sh
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Configuring iptables firewall..."
|
echo "Configuring iptables firewall..."
|
||||||
$DIR/iptables-setup.sh
|
$DIR/iptables-setup.sh
|
||||||
@ -44,6 +40,10 @@ echo "Adding cron jobs..."
|
|||||||
yes | cp -rf $DIR/checkserver.sh $CHECKSERVER
|
yes | cp -rf $DIR/checkserver.sh $CHECKSERVER
|
||||||
$DIR/autostart.sh
|
$DIR/autostart.sh
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Configuring VPN users..."
|
||||||
|
$DIR/adduser.sh
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Starting pptpd..."
|
echo "Starting pptpd..."
|
||||||
service pptpd restart
|
service pptpd restart
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user