Last active
August 20, 2021 14:15
-
-
Save PJTewkesbury/9ae202e72b8d2943579e5f70ce447a30 to your computer and use it in GitHub Desktop.
VPNServer install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Software Configuration File | |
# --------------------------- | |
# | |
# You may edit this file when the VPN Server / Client / Bridge program is not running. | |
# | |
# In prior to edit this file manually by your text editor, | |
# shutdown the VPN Server / Client / Bridge background service. | |
# Otherwise, all changes will be lost. | |
# | |
declare root | |
{ | |
uint ConfigRevision 11 | |
bool IPsecMessageDisplayed true | |
string Region GB | |
bool VgsMessageDisplayed false | |
declare DDnsClient | |
{ | |
bool Disabled false | |
byte Key /NykDxW0nQnmOlp0czurYDIQF5g= | |
string LocalHostname naspi | |
string ProxyHostName $ | |
uint ProxyPort 0 | |
uint ProxyType 0 | |
string ProxyUsername $ | |
} | |
declare IPsec | |
{ | |
bool EtherIP_IPsec true | |
string IPsec_Secret Sweep2021 | |
string L2TP_DefaultHub VPN | |
bool L2TP_IPsec true | |
bool L2TP_Raw false | |
declare EtherIP_IDSettingsList | |
{ | |
} | |
} | |
declare ListenerList | |
{ | |
declare Listener0 | |
{ | |
bool DisableDos false | |
bool Enabled true | |
uint Port 443 | |
} | |
declare Listener1 | |
{ | |
bool DisableDos false | |
bool Enabled true | |
uint Port 992 | |
} | |
declare Listener2 | |
{ | |
bool DisableDos false | |
bool Enabled true | |
uint Port 1194 | |
} | |
declare Listener3 | |
{ | |
bool DisableDos false | |
bool Enabled true | |
uint Port 5555 | |
} | |
} | |
declare LocalBridgeList | |
{ | |
bool DoNotDisableOffloading false | |
declare LocalBridge0 | |
{ | |
string DeviceName eth0 | |
string HubName VPN | |
bool LimitBroadcast false | |
bool MonitorMode false | |
bool NoPromiscuousMode false | |
bool TapMode false | |
} | |
} | |
declare ServerConfiguration | |
{ | |
bool AcceptOnlyTls true | |
uint64 AutoDeleteCheckDiskFreeSpaceMin 104857600 | |
uint AutoDeleteCheckIntervalSecs 300 | |
uint AutoSaveConfigSpan 300 | |
bool BackupConfigOnlyWhenModified true | |
string CipherName AES128-SHA | |
uint CurrentBuild 9760 | |
bool DisableCoreDumpOnUnix false | |
bool DisableDeadLockCheck false | |
bool DisableDosProction false | |
bool DisableGetHostNameWhenAcceptTcp false | |
bool DisableIntelAesAcceleration false | |
bool DisableIPsecAggressiveMode false | |
bool DisableIPv6Listener false | |
bool DisableJsonRpcWebApi false | |
bool DisableNatTraversal false | |
bool DisableOpenVPNServer false | |
bool DisableSessionReconnect false | |
bool DisableSSTPServer false | |
bool DontBackupConfig false | |
bool EnableVpnAzure false | |
bool EnableVpnOverDns false | |
bool EnableVpnOverIcmp false | |
byte HashedPassword 7TKntgi/t3sfWWh9/cL2/y5iNK0= | |
string KeepConnectHost keepalive.softether.org | |
uint KeepConnectInterval 50 | |
uint KeepConnectPort 80 | |
uint KeepConnectProtocol 1 | |
uint64 LoggerMaxLogSize 1073741823 | |
uint MaxConcurrentDnsClientThreads 64 | |
uint MaxConnectionsPerIP 256 | |
uint MaxUnestablishedConnections 1000 | |
bool NoHighPriorityProcess false | |
bool NoLinuxArpFilter false | |
bool NoSendSignature false | |
string OpenVPNDefaultClientOption dev-type$20tun,link-mtu$201500,tun-mtu$201500,cipher$20AES-128-CBC,auth$20SHA1,keysize$20128,key-method$202,tls-client | |
string OpenVPN_UdpPortList 1194 | |
bool SaveDebugLog false | |
byte ServerCert MIID+jCCAuKgAwIBAgIBADANBgkqhkiG9w0BAQsFADB8MSMwIQYDVQQDDBp2cG4yMDk4MzEwNzUuc29mdGV0aGVyLm5ldDEjMCEGA1UECgwadnBuMjA5ODMxMDc1LnNvZnRldGhlci5uZXQxIzAhBgNVBAsMGnZwbjIwOTgzMTA3NS5zb2Z0ZXRoZXIubmV0MQswCQYDVQQGEwJVUzAeFw0yMTA4MjAxMzE5NThaFw0zNzEyMzExMzE5NThaMHwxIzAhBgNVBAMMGnZwbjIwOTgzM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6R4Yfybw5OynJheXPYObuobfo2fhUtWevsTfiC0eJrQRl+53DmRYb2yEuYu82sfNUcpRAgBdncWgWXbBmn/tC7ZTYnaGhmlc5q36XTd3EbFhH4/XhPOsAh3hgsbrt4zDHuO8L/Wcp0/+rk2BEwYJ+JI8Jt9KMVkmhdz8WzECgYBQmoujV1Kl8ssiwIFMBUDz2qWJ5AUvtckNUae3R9N7TJWZtQNHYlF5mor2gY2VEsNKbILTukUkaWWv1jChuSDd73Ut8YzaCaJcYYjh2A5H+CVbe3R6BmNFA3bvC9+cBOXu+fUT12CkNOwHvU4c1HVC0dtzgx4f1rvqOcGI1qoTyQKBgQDGECmcYXTVgEElF0OVxFbSTKwLUeSnCVZQak+5+19MESQe1RVbxa6y5aUhoofhFOKD9u9L09JpbjWM1wgBHpLPkCH8Zu3U8N/v0nmFRNSbGOxfz59uP9UOvK5Q337425TU4RfdM0FTD1jRTYeOlTem3BKAbIKXbJeddvO6LVMSuw== | |
uint ServerLogSwitchType 4 | |
uint ServerType 0 | |
bool StrictSyslogDatetimeFormat false | |
bool Tls_Disable1_0 false | |
bool Tls_Disable1_1 false | |
bool Tls_Disable1_2 false | |
bool Tls_Disable1_3 false | |
bool UseKeepConnect true | |
bool UseWebTimePage false | |
bool UseWebUI false | |
declare GlobalParams | |
{ | |
uint FIFO_BUDGET 1000000 | |
uint HUB_ARP_SEND_INTERVAL 5000 | |
uint IP_TABLE_EXPIRE_TIME 60000 | |
uint IP_TABLE_EXPIRE_TIME_DHCP 300000 | |
uint MAC_TABLE_EXPIRE_TIME 600000 | |
uint MAX_BUFFERING_PACKET_SIZE 480000 | |
uint MAX_HUB_LINKS 1024 | |
uint MAX_IP_TABLES 65536 | |
uint MAX_MAC_TABLES 65536 | |
uint MAX_SEND_SOCKET_QUEUE_NUM 128 | |
uint MAX_SEND_SOCKET_QUEUE_SIZE 320000 | |
uint MAX_STORED_QUEUE_NUM 384 | |
uint MEM_FIFO_REALLOC_MEM_SIZE 65536 | |
uint MIN_SEND_SOCKET_QUEUE_SIZE 80000 | |
uint QUEUE_BUDGET 1024 | |
uint SELECT_TIME 256 | |
uint SELECT_TIME_FOR_NAT 30 | |
uint STORM_CHECK_SPAN 500 | |
uint STORM_DISCARD_VALUE_END 1024 | |
uint STORM_DISCARD_VALUE_START 3 | |
} | |
declare ServerTraffic | |
{ | |
declare RecvTraffic | |
{ | |
uint64 BroadcastBytes 185069 | |
uint64 BroadcastCount 549 | |
uint64 UnicastBytes 308298 | |
uint64 UnicastCount 1795 | |
} | |
declare SendTraffic | |
{ | |
uint64 BroadcastBytes 123777 | |
uint64 BroadcastCount 382 | |
uint64 UnicastBytes 31985 | |
uint64 UnicastCount 307 | |
} | |
} | |
declare SyslogSettings | |
{ | |
string HostName $ | |
uint Port 0 | |
uint SaveType 0 | |
} | |
} | |
declare VirtualHUB | |
{ | |
declare VPN | |
{ | |
uint64 CreatedTime 1629433171475 | |
byte HashedPassword +WzqGYrR3VYXrAhKPZLGEHcIwO8= | |
uint64 LastCommTime 1629434338004 | |
uint64 LastLoginTime 1629434254551 | |
uint NumLogin 1 | |
bool Online true | |
bool RadiusConvertAllMsChapv2AuthRequestToEap false | |
string RadiusRealm $ | |
uint RadiusRetryInterval 0 | |
uint RadiusServerPort 1812 | |
string RadiusSuffixFilter $ | |
bool RadiusUsePeapInsteadOfEap false | |
byte SecurePassword bpw3X/O5E8a6G6ccnl4uXmDtkwI= | |
uint Type 0 | |
declare AccessList | |
{ | |
} | |
declare AdminOption | |
{ | |
uint allow_hub_admin_change_option 0 | |
uint deny_bridge 0 | |
uint deny_change_user_password 0 | |
uint deny_empty_password 0 | |
uint deny_hub_admin_change_ext_option 0 | |
uint deny_qos 0 | |
uint deny_routing 0 | |
uint max_accesslists 0 | |
uint max_bitrates_download 0 | |
uint max_bitrates_upload 0 | |
uint max_groups 0 | |
uint max_multilogins_per_user 0 | |
uint max_sessions 0 | |
uint max_sessions_bridge 0 | |
uint max_sessions_client 0 | |
uint max_sessions_client_bridge_apply 0 | |
uint max_users 0 | |
uint no_access_list_include_file 0 | |
uint no_cascade 0 | |
uint no_change_access_control_list 0 | |
uint no_change_access_list 0 | |
uint no_change_admin_password 0 | |
uint no_change_cert_list 0 | |
uint no_change_crl_list 0 | |
uint no_change_groups 0 | |
uint no_change_log_config 0 | |
uint no_change_log_switch_type 0 | |
uint no_change_msg 0 | |
uint no_change_users 0 | |
uint no_delay_jitter_packet_loss 0 | |
uint no_delete_iptable 0 | |
uint no_delete_mactable 0 | |
uint no_disconnect_session 0 | |
uint no_enum_session 0 | |
uint no_offline 0 | |
uint no_online 0 | |
uint no_query_session 0 | |
uint no_read_log_file 0 | |
uint no_securenat 0 | |
uint no_securenat_enabledhcp 0 | |
uint no_securenat_enablenat 0 | |
} | |
declare CascadeList | |
{ | |
} | |
declare LogSetting | |
{ | |
uint PacketLogSwitchType 4 | |
uint PACKET_LOG_ARP 0 | |
uint PACKET_LOG_DHCP 1 | |
uint PACKET_LOG_ETHERNET 0 | |
uint PACKET_LOG_ICMP 0 | |
uint PACKET_LOG_IP 0 | |
uint PACKET_LOG_TCP 0 | |
uint PACKET_LOG_TCP_CONN 1 | |
uint PACKET_LOG_UDP 0 | |
bool SavePacketLog true | |
bool SaveSecurityLog true | |
uint SecurityLogSwitchType 4 | |
} | |
declare Message | |
{ | |
} | |
declare Option | |
{ | |
uint AccessListIncludeFileCacheLifetime 30 | |
uint AdjustTcpMssValue 0 | |
bool ApplyIPv4AccessListOnArpPacket false | |
bool AssignVLanIdByRadiusAttribute false | |
bool BroadcastLimiterStrictMode false | |
uint BroadcastStormDetectionThreshold 0 | |
uint ClientMinimumRequiredBuild 0 | |
bool DenyAllRadiusLoginWithNoVlanAssign false | |
uint DetectDormantSessionInterval 0 | |
bool DisableAdjustTcpMss false | |
bool DisableCheckMacOnLocalBridge false | |
bool DisableCorrectIpOffloadChecksum false | |
bool DisableHttpParsing false | |
bool DisableIPParsing false | |
bool DisableIpRawModeSecureNAT false | |
bool DisableKernelModeSecureNAT false | |
bool DisableUdpAcceleration false | |
bool DisableUdpFilterForLocalBridgeNic false | |
bool DisableUserModeSecureNAT false | |
bool DoNotSaveHeavySecurityLogs false | |
bool DropArpInPrivacyFilterMode true | |
bool DropBroadcastsInPrivacyFilterMode true | |
bool FilterBPDU false | |
bool FilterIPv4 false | |
bool FilterIPv6 false | |
bool FilterNonIP false | |
bool FilterOSPF false | |
bool FilterPPPoE false | |
uint FloodingSendQueueBufferQuota 33554432 | |
bool ManageOnlyLocalUnicastIPv6 true | |
bool ManageOnlyPrivateIP true | |
uint MaxLoggedPacketsPerMinute 0 | |
uint MaxSession 0 | |
bool NoArpPolling false | |
bool NoDhcpPacketLogOutsideHub true | |
bool NoEnum false | |
bool NoIpTable false | |
bool NoIPv4PacketLog false | |
bool NoIPv6AddrPolling false | |
bool NoIPv6DefaultRouterInRAWhenIPv6 true | |
bool NoIPv6PacketLog false | |
bool NoLookBPDUBridgeId false | |
bool NoMacAddressLog true | |
bool NoManageVlanId false | |
bool NoPhysicalIPOnPacketLog false | |
bool NoSpinLockForPacketDelay false | |
bool RemoveDefGwOnDhcpForLocalhost true | |
uint RequiredClientId 0 | |
uint SecureNAT_MaxDnsSessionsPerIp 0 | |
uint SecureNAT_MaxIcmpSessionsPerIp 0 | |
uint SecureNAT_MaxTcpSessionsPerIp 0 | |
uint SecureNAT_MaxTcpSynSentPerIp 0 | |
uint SecureNAT_MaxUdpSessionsPerIp 0 | |
bool SecureNAT_RandomizeAssignIp false | |
bool SuppressClientUpdateNotification false | |
bool UseHubNameAsDhcpUserClassOption false | |
bool UseHubNameAsRadiusNasId false | |
string VlanTypeId 0x8100 | |
bool YieldAfterStorePacket false | |
} | |
declare SecureNAT | |
{ | |
bool Disabled true | |
bool SaveLog true | |
declare VirtualDhcpServer | |
{ | |
string DhcpDnsServerAddress 192.168.30.1 | |
string DhcpDnsServerAddress2 0.0.0.0 | |
string DhcpDomainName $ | |
bool DhcpEnabled true | |
uint DhcpExpireTimeSpan 7200 | |
string DhcpGatewayAddress 192.168.30.1 | |
string DhcpLeaseIPEnd 192.168.30.200 | |
string DhcpLeaseIPStart 192.168.30.10 | |
string DhcpPushRoutes $ | |
string DhcpSubnetMask 255.255.255.0 | |
} | |
declare VirtualHost | |
{ | |
string VirtualHostIp 192.168.30.1 | |
string VirtualHostIpSubnetMask 255.255.255.0 | |
string VirtualHostMacAddress 5E-13-67-D1-FA-A5 | |
} | |
declare VirtualRouter | |
{ | |
bool NatEnabled true | |
uint NatMtu 1500 | |
uint NatTcpTimeout 1800 | |
uint NatUdpTimeout 60 | |
} | |
} | |
declare SecurityAccountDatabase | |
{ | |
declare CertList | |
{ | |
} | |
declare CrlList | |
{ | |
} | |
declare GroupList | |
{ | |
} | |
declare IPAccessControlList | |
{ | |
} | |
declare UserList | |
{ | |
declare pjtewkesbury | |
{ | |
byte AuthNtLmSecureHash A5mXCSD8+Fn/OA7UPAaM7g== | |
byte AuthPassword XbHYaxec81zMRGFL5NC7Ahj12Po= | |
uint AuthType 1 | |
uint64 CreatedTime 1629433248192 | |
uint64 ExpireTime 0 | |
uint64 LastLoginTime 1629434254551 | |
string Note $ | |
uint NumLogin 1 | |
string RealName Peter$20Tewkesbury | |
uint64 UpdatedTime 1629433248192 | |
declare Traffic | |
{ | |
declare RecvTraffic | |
{ | |
uint64 BroadcastBytes 122422 | |
uint64 BroadcastCount 377 | |
uint64 UnicastBytes 17659 | |
uint64 UnicastCount 57 | |
} | |
declare SendTraffic | |
{ | |
uint64 BroadcastBytes 3995 | |
uint64 BroadcastCount 13 | |
uint64 UnicastBytes 5006 | |
uint64 UnicastCount 48 | |
} | |
} | |
} | |
} | |
} | |
declare Traffic | |
{ | |
declare RecvTraffic | |
{ | |
uint64 BroadcastBytes 185069 | |
uint64 BroadcastCount 549 | |
uint64 UnicastBytes 308298 | |
uint64 UnicastCount 1795 | |
} | |
declare SendTraffic | |
{ | |
uint64 BroadcastBytes 123777 | |
uint64 BroadcastCount 382 | |
uint64 UnicastBytes 31985 | |
uint64 UnicastCount 307 | |
} | |
} | |
} | |
} | |
declare VirtualLayer3SwitchList | |
{ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define console colors | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
# Execute as sudo | |
(( EUID != 0 )) && exec sudo -- "$0" "$@" | |
clear | |
# User confirmation | |
read -rep $'!!! IMPORTANT !!!\n\nThis script will remove SoftEther if it has been previously installed. Please backup your config file via the GUI manager or copy it from /opt/vpnserver/ if you are upgrading.\n\nThis will download and compile SoftEther VPN on your server. Are you sure you want to continue? [y/N] ' response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
# REMOVE PREVIOUS INSTALL | |
# Check for SE install folder | |
if [ -d "/opt/vpnserver" ]; then | |
rm -rf /opt/vpnserver > /dev/null 2>&1 | |
fi | |
if [ -d "/tmp/softether-autoinstall" ]; then | |
rm -rf /tmp/softether-autoinstall > /dev/null 2>&1 | |
fi | |
# Check for init script | |
if | |
[ -f "/etc/init.d/vpnserver" ]; then rm /etc/init.d/vpnserver; | |
fi | |
# Remove vpnserver from systemd | |
update-rc.d vpnserver remove > /dev/null 2>&1 | |
# Create working directory | |
mkdir -p /tmp/softether-autoinstall | |
cd /tmp/softether-autoinstall | |
# Perform apt update & install necessary software | |
apt update && apt install wget && apt install net-tools | |
# Install build-essential and checkinstall | |
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' build-essential|grep "install ok installed") | |
echo "Checking for build-essential: $PKG_OK" | |
if [ "" == "$PKG_OK" ]; then | |
echo "build-essential not installed. Installing now." | |
sudo apt install -y build-essential | |
fi | |
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' checkinstall|grep "install ok installed") | |
echo "Checking for checkinstall: $PKG_OK" | |
if [ "" == "$PKG_OK" ]; then | |
echo "checkinstall not installed. Installing now." | |
sudo apt install -y checkinstall | |
fi | |
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' build-essential|grep "install ok installed") | |
echo "Checking for build-essential: $PKG_OK" | |
if [ "" == "$PKG_OK" ]; then | |
echo "build-essential is still not installed. Possible problem with apt? Exiting." | |
exit 1 | |
fi | |
# Download SoftEther | Version 4.34 | Build 9745 | |
printf "\nDownloading release: ${RED}4.34 RTM${NC} | Build ${RED}9745${NC}\n\n" | |
wget -O vpnserver.tar.gz https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-arm_eabi-32bit.tar.gz | |
tar -xzf vpnserver.tar.gz | |
cd vpnserver | |
echo $'1\n1\n1' | make && | |
cd /tmp/softether-autoinstall && mv vpnserver/ /opt | |
chmod 600 /opt/vpnserver/* && chmod 700 /opt/vpnserver/vpncmd && chmod 700 /opt/vpnserver/vpnserver | |
cd /tmp/softether-autoinstall | |
PS3='Are you going to use the bridge option on the VPN server? If unsure or are using SecureNAT, select No.' | |
options=("Yes" "No" "Quit") | |
select opt in "${options[@]}" | |
do | |
case $opt in | |
"Yes") | |
apt install -y dnsmasq | |
wget -O dnsmasq.conf https://raw.githubusercontent.com/icoexist/softether-autoinstall/master/dnsmasq.conf | |
rm /etc/dnsmasq.conf && mv dnsmasq.conf /etc/dnsmasq.conf | |
wget -O vpnserver-init-bridge https://raw.githubusercontent.com/icoexist/softether-autoinstall/master/vpnserver-init-bridge > /dev/null 2>&1 | |
mv vpnserver-init-bridge /etc/init.d/vpnserver | |
chmod 755 /etc/init.d/vpnserver | |
printf "\nSystem daemon created. Registering changes...\n\n" | |
update-rc.d vpnserver defaults > /dev/null 2>&1 | |
printf "\nSoftEther VPN Server should now start as a system service from now on.\n\n" | |
systemctl start vpnserver | |
systemctl restart dnsmasq | |
printf "\nCleaning up...\n\n" | |
cd && rm -rf /tmp/softether-autoinstall > /dev/null 2>&1 | |
systemctl is-active --quiet vpnserver && echo "Service vpnserver is running." | |
printf "\n${RED}!!! IMPORTANT !!!${NC}\n\nTo configure the server, use the SoftEther VPN Server Manager located here: http://bit.ly/2D30Wj8 or use ${RED}sudo /opt/vpnserver/vpncmd${NC}\n\n${RED}!!! UFW is not enabled with this script !!!${NC}\n\nTo see how to open ports for SoftEther VPN, please go here: http://bit.ly/2JdZPx6\n\nNeed help? Feel free to join the Discord server: https://icoexist.io/discord\n\n" | |
printf "\n${RED}!!! IMPORTANT !!!${NC}\n\nYou still need to add the local bridge using the SoftEther VPN Server Manager. It is important that after you add the local bridge, you restart both dnsmasq and the vpnserver!\nSee the tutorial here: http://bit.ly/2HoxlQO\n\n" | |
break | |
;; | |
"No") | |
wget -O vpnserver-init https://raw.githubusercontent.com/icoexist/softether-autoinstall/master/vpnserver-init > /dev/null 2>&1 | |
mv vpnserver-init /etc/init.d/vpnserver | |
chmod 755 /etc/init.d/vpnserver | |
printf "\nSystem daemon created. Registering changes...\n\n" | |
update-rc.d vpnserver defaults > /dev/null 2>&1 | |
printf "\nSoftEther VPN Server should now start as a system service from now on.\n\n" | |
systemctl start vpnserver | |
printf "\nCleaning up...\n\n" | |
cd && rm -rf /tmp/softether-autoinstall > /dev/null 2>&1 | |
systemctl is-active --quiet vpnserver && echo "Service vpnserver is running." | |
printf "\n${RED}!!! IMPORTANT !!!${NC}\n\nTo configure the server, use the SoftEther VPN Server Manager located here: http://bit.ly/2D30Wj8 or use ${RED}sudo /opt/vpnserver/vpncmd${NC}\n\n${RED}!!! UFW is not enabled with this script !!!${NC}\n\nTo see how to open ports for SoftEther VPN, please go here: http://bit.ly/2JdZPx6\n\nNeed help? Feel free to join the Discord server: https://icoexist.io/discord\n\n" | |
break | |
;; | |
"Quit") | |
break | |
;; | |
*) echo "invalid option $REPLY";; | |
esac | |
done | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# description: SoftEther VPN Server | |
### BEGIN INIT INFO | |
# Provides: vpnserver | |
# Required-Start: $local_fs $network | |
# Required-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: softether vpnserver | |
# Description: softether vpnserver daemon | |
### END INIT INFO | |
DAEMON=/opt/vpnserver/vpnserver | |
LOCK=/var/lock/subsys/vpnserver | |
test -x $DAEMON || exit 0 | |
case "$1" in | |
start) | |
$DAEMON start | |
touch $LOCK | |
;; | |
stop) | |
$DAEMON stop | |
rm $LOCK | |
;; | |
restart) | |
$DAEMON stop | |
sleep 3 | |
$DAEMON start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment