mirror of
https://github.com/pivpn/pivpn.git
synced 2025-05-14 03:44:11 +02:00
Added Alpine Linux support (#1567)
This commit is contained in:
parent
718d3df573
commit
edb36c08f7
22 changed files with 852 additions and 459 deletions
|
@ -18,6 +18,8 @@ date=$(date +%Y%m%d-%H%M%S)
|
|||
setupVarsFile="setupVars.conf"
|
||||
setupConfigDir="/etc/pivpn"
|
||||
|
||||
CHECK_PKG_INSTALLED='dpkg-query -s'
|
||||
|
||||
if [ -r "${setupConfigDir}/wireguard/${setupVarsFile}" ] && [ -r "${setupConfigDir}/openvpn/${setupVarsFile}" ]; then
|
||||
|
||||
# Two protocols have been installed, check if the script has passed
|
||||
|
@ -57,6 +59,10 @@ fi
|
|||
# shellcheck disable=SC1090
|
||||
source "${setupVars}"
|
||||
|
||||
if [ "${PLAT}" == 'Alpine' ]; then
|
||||
CHECK_PKG_INSTALLED='apk --no-cache info -e'
|
||||
fi
|
||||
|
||||
checkbackupdir(){
|
||||
|
||||
# Disabling shellcheck error $install_home sourced from $setupVars
|
||||
|
@ -90,8 +96,8 @@ backup_wireguard(){
|
|||
|
||||
}
|
||||
|
||||
if [[ ! $EUID -eq 0 ]];then
|
||||
if [[ $(dpkg-query -s sudo) ]];then
|
||||
if [[ ! $EUID -eq 0 ]]; then
|
||||
if eval "${CHECK_PKG_INSTALLED} sudo" &> /dev/null; then
|
||||
export SUDO="sudo"
|
||||
else
|
||||
echo "::: Please install sudo or run this as root."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue