mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 10:50:16 +00:00
refactor: Harmonize ownership
fix #1608: Use same moethod to define ownership in bot makeOVPN and makeCONF scripts
This commit is contained in:
parent
f7f81e1bf4
commit
704d9f9795
1 changed files with 6 additions and 2 deletions
|
@ -14,6 +14,10 @@ INDEX="/etc/openvpn/easy-rsa/pki/index.txt"
|
|||
# shellcheck disable=SC1090
|
||||
source "${setupVars}"
|
||||
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
userGroup="${install_user}:${install_user}"
|
||||
|
||||
## Functions
|
||||
err() {
|
||||
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
|
||||
|
@ -286,7 +290,7 @@ done
|
|||
# shellcheck disable=SC2154
|
||||
if [[ ! -d "${install_home}/ovpns" ]]; then
|
||||
mkdir "${install_home}/ovpns"
|
||||
chown "${install_user}:${install_user}" "${install_home}/ovpns"
|
||||
chown "${userGroup}" "${install_home}/ovpns"
|
||||
chmod 0750 "${install_home}/ovpns"
|
||||
fi
|
||||
|
||||
|
@ -456,7 +460,7 @@ if [[ "${iOS}" == 1 ]]; then
|
|||
-name "${NAME}" \
|
||||
-out "${install_home}/ovpns/${NAME}.ovpn12"
|
||||
|
||||
chown "${install_user}:${install_user}" "${install_home}/ovpns/${NAME}.ovpn12"
|
||||
chown "${userGroup}" "${install_home}/ovpns/${NAME}.ovpn12"
|
||||
chmod 640 "${install_home}/ovpns/${NAME}.ovpn12"
|
||||
|
||||
printf "========================================================\n"
|
||||
|
|
Loading…
Reference in a new issue