This commit is contained in:
redfast00 2016-12-06 18:46:48 +01:00
parent f61b26f669
commit 96bef0c085
No known key found for this signature in database
GPG key ID: B7DD106EAC545F95

View file

@ -18,7 +18,7 @@ pivpnFilesDir="/etc/.pivpn"
easyrsaRel="https://github.com/pivpn/easy-rsa/releases/download/3.0.1-pivpn/EasyRSA-3.0.1-pivpn.tgz" easyrsaRel="https://github.com/pivpn/easy-rsa/releases/download/3.0.1-pivpn/EasyRSA-3.0.1-pivpn.tgz"
# Find the rows and columns. Will default to 80x24 if it can not be detected. # Find the rows and columns. Will default to 80x24 if it can not be detected.
screen_size=$(stty size 2>/dev/null || echo 24 80) screen_size=$(stty size 2>/dev/null || echo 24 80)
rows=$(echo $screen_size | awk '{print $1}') rows=$(echo $screen_size | awk '{print $1}')
columns=$(echo $screen_size | awk '{print $2}') columns=$(echo $screen_size | awk '{print $2}')
@ -203,7 +203,7 @@ verifyFreeDiskSpace() {
*) *)
echo "::: Confirmation not received, exiting..." echo "::: Confirmation not received, exiting..."
exit 1 exit 1
;; ;;
esac esac
# - Insufficient free disk space # - Insufficient free disk space
elif [[ ${existing_free_kilobytes} -lt ${required_free_kilobytes} ]]; then elif [[ ${existing_free_kilobytes} -lt ${required_free_kilobytes} ]]; then
@ -319,6 +319,8 @@ It is also possible to use a DHCP reservation, but if you are going to do that,
} }
setDHCPCD() { setDHCPCD() {
# First, create the dhcpd config file
touch ${dhcpcdFile}
# Append these lines to dhcpcd.conf to enable a static IP # Append these lines to dhcpcd.conf to enable a static IP
echo "## interface ${pivpnInterface} echo "## interface ${pivpnInterface}
static ip_address=${IPv4addr} static ip_address=${IPv4addr}
@ -328,7 +330,7 @@ setDHCPCD() {
setStaticIPv4() { setStaticIPv4() {
# Tries to set the IPv4 address # Tries to set the IPv4 address
if [[ -f /etc/dhcpcd.conf ]]; then if [[ -f ${dhcpcdFile} ]]; then
if grep -q "${IPv4addr}" ${dhcpcdFile}; then if grep -q "${IPv4addr}" ${dhcpcdFile}; then
echo "::: Static IP already configured." echo "::: Static IP already configured."
: :