#!/usr/bin/env bash
set -o errexit

# N4IRS 12/27/2021

#################################################
#                                               #
#    Download and install DVSwitch Server       #
#                                               #
#################################################

if [[ $(/usr/bin/id -u) -ne 0 ]]; then
    echo "Not running as root"
    echo "either run as root or with sudo"
    exit
fi

cd /
wget http://dvswitch.org/dvswitch-server-hamvoip.zip
unzip dvswitch-server-hamvoip.zip
/usr/local/sbin/dvswitch-install.sh

echo "please reboot"
