mirror of
https://github.com/pivpn/pivpn.git
synced 2025-04-24 08:10:10 +00:00
Added Alpine Linux support (#1567)
This commit is contained in:
parent
718d3df573
commit
edb36c08f7
22 changed files with 852 additions and 459 deletions
|
@ -1,8 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
CHECK_PKG_INSTALLED='dpkg-query -s'
|
||||
|
||||
if grep -qsEe "^NAME\=['\"]?Alpine[a-zA-Z ]*['\"]?$" /etc/os-release; then
|
||||
CHECK_PKG_INSTALLED='apk --no-cache info -e'
|
||||
fi
|
||||
|
||||
# Must be root to use this tool
|
||||
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