mirror of
https://github.com/pivpn/pivpn.git
synced 2025-03-28 19:21:26 +00:00
add custom git url and branch options
This commit is contained in:
parent
aeb3eef884
commit
75cebe13a5
1 changed files with 24 additions and 9 deletions
|
@ -13,7 +13,8 @@
|
||||||
|
|
||||||
######## VARIABLES #########
|
######## VARIABLES #########
|
||||||
pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
||||||
#pivpnGitUrl="/home/pi/repos/pivpn"
|
# Uncomment to checkout a custom branch for local pivpn files
|
||||||
|
#pivpnGitBranch="custombranchtocheckout"
|
||||||
setupVarsFile="setupVars.conf"
|
setupVarsFile="setupVars.conf"
|
||||||
setupConfigDir="/etc/pivpn"
|
setupConfigDir="/etc/pivpn"
|
||||||
tempsetupVarsFile="/tmp/setupVars.conf"
|
tempsetupVarsFile="/tmp/setupVars.conf"
|
||||||
|
@ -150,6 +151,8 @@ flagsCheck(){
|
||||||
"--unattended" ) runUnattended=true; unattendedConfig="${!j}";;
|
"--unattended" ) runUnattended=true; unattendedConfig="${!j}";;
|
||||||
"--reconfigure" ) reconfigure=true;;
|
"--reconfigure" ) reconfigure=true;;
|
||||||
"--show-unsupported-nics" ) showUnsupportedNICs=true;;
|
"--show-unsupported-nics" ) showUnsupportedNICs=true;;
|
||||||
|
"--giturl" ) pivpnGitUrl="${!j}";;
|
||||||
|
"--gitbranch" ) pivpnGitBranch="${!j}";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -978,7 +981,7 @@ updateRepo(){
|
||||||
echo "::: Repairing an existing installation, not downloading/updating local repos"
|
echo "::: Repairing an existing installation, not downloading/updating local repos"
|
||||||
else
|
else
|
||||||
# Pull the latest commits
|
# Pull the latest commits
|
||||||
echo -n "::: Updating repo in $1..."
|
echo -n "::: Updating repo in ${1} from ${2} ..."
|
||||||
### FIXME: Never call rm -rf with a plain variable. Never again as SU!
|
### FIXME: Never call rm -rf with a plain variable. Never again as SU!
|
||||||
#$SUDO rm -rf "${1}"
|
#$SUDO rm -rf "${1}"
|
||||||
if test -n "$1"; then
|
if test -n "$1"; then
|
||||||
|
@ -989,18 +992,24 @@ updateRepo(){
|
||||||
cd /usr/local/src && \
|
cd /usr/local/src && \
|
||||||
$SUDO git clone -q --depth 1 --no-single-branch "${2}" "${1}" > /dev/null & spinner $!
|
$SUDO git clone -q --depth 1 --no-single-branch "${2}" "${1}" > /dev/null & spinner $!
|
||||||
cd "${1}" || exit 1
|
cd "${1}" || exit 1
|
||||||
if [ -z "${TESTING+x}" ]; then
|
echo " done!"
|
||||||
|
if [ ! -z "${pivpnGitBranch}" ]; then
|
||||||
|
echo "::: Checkout branch '${pivpnGitBranch}' from ${2} in ${1}..."
|
||||||
|
${SUDOE} git checkout -q ${pivpnGitBranch}
|
||||||
|
echo "::: Custom branch checkout done!"
|
||||||
|
elif [ -z "${TESTING+x}" ]; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
${SUDOE} git checkout test
|
echo "::: Checkout branch 'test' from ${2} in ${1}..."
|
||||||
|
${SUDOE} git checkout -q test
|
||||||
|
echo "::: 'test' branch checkout done!"
|
||||||
fi
|
fi
|
||||||
echo " done!"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
makeRepo(){
|
makeRepo(){
|
||||||
# Remove the non-repos interface and clone the interface
|
# Remove the non-repos interface and clone the interface
|
||||||
echo -n "::: Cloning $2 into $1..."
|
echo -n "::: Cloning ${2} into ${1} ..."
|
||||||
### FIXME: Never call rm -rf with a plain variable. Never again as SU!
|
### FIXME: Never call rm -rf with a plain variable. Never again as SU!
|
||||||
#$SUDO rm -rf "${1}"
|
#$SUDO rm -rf "${1}"
|
||||||
if test -n "$1"; then
|
if test -n "$1"; then
|
||||||
|
@ -1011,12 +1020,18 @@ makeRepo(){
|
||||||
cd /usr/local/src && \
|
cd /usr/local/src && \
|
||||||
$SUDO git clone -q --depth 1 --no-single-branch "${2}" "${1}" > /dev/null & spinner $!
|
$SUDO git clone -q --depth 1 --no-single-branch "${2}" "${1}" > /dev/null & spinner $!
|
||||||
cd "${1}" || exit 1
|
cd "${1}" || exit 1
|
||||||
if [ -z "${TESTING+x}" ]; then
|
echo " done!"
|
||||||
|
if [ ! -z "${pivpnGitBranch}" ]; then
|
||||||
|
echo "::: Checkout branch '${pivpnGitBranch}' from ${2} in ${1}..."
|
||||||
|
${SUDOE} git checkout -q ${pivpnGitBranch}
|
||||||
|
echo "::: Custom branch checkout done!"
|
||||||
|
elif [ -z "${TESTING+x}" ]; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
${SUDOE} git checkout test
|
echo "::: Checkout branch 'test' from ${2} in ${1}..."
|
||||||
|
${SUDOE} git checkout -q test
|
||||||
|
echo "::: 'test' branch checkout done!"
|
||||||
fi
|
fi
|
||||||
echo " done!"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getGitFiles(){
|
getGitFiles(){
|
||||||
|
|
Loading…
Add table
Reference in a new issue