mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-21 06:18:28 +00:00
Add datadir and dataprefix arguments to install
This commit is contained in:
parent
283c04dd81
commit
f8789764dc
@ -48,6 +48,12 @@ arkautorestartfile="${arkautorestartfile:-ShooterGame/Saved/.autorestart}"
|
|||||||
install_bindir="${install_bindir:-${0%/*}}"
|
install_bindir="${install_bindir:-${0%/*}}"
|
||||||
install_libexecdir="${install_libexecdir:-${install_bindir%/*}/libexec/arkmanager}"
|
install_libexecdir="${install_libexecdir:-${install_bindir%/*}/libexec/arkmanager}"
|
||||||
|
|
||||||
|
if [ "$steamcmd_user" == "--me" ]; then
|
||||||
|
install_datadir="${install_datadir:-${HOME}/.share/local/arkmanager}"
|
||||||
|
else
|
||||||
|
install_datadir="${install_datadir:-${install_bindir%/*}/share/arkmanager}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Script version
|
# Script version
|
||||||
arkstVersion="1.3"
|
arkstVersion="1.3"
|
||||||
arkstCommit=''
|
arkstCommit=''
|
||||||
@ -985,6 +991,9 @@ doUpgrade() {
|
|||||||
if [ -n "$install_libexecdir" ]; then
|
if [ -n "$install_libexecdir" ]; then
|
||||||
reinstall_args=( "${reinstall_args[@]}" "--libexecdir" "$install_libexecdir" )
|
reinstall_args=( "${reinstall_args[@]}" "--libexecdir" "$install_libexecdir" )
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$install_datadir" ]; then
|
||||||
|
reinstall_args=( "${reinstall_args[@]}" "--datadir" "$install_datadir" )
|
||||||
|
fi
|
||||||
if [[ $arkstLatestVersion > $arkstVersion ]]; then
|
if [[ $arkstLatestVersion > $arkstVersion ]]; then
|
||||||
read -p "A new version was found! Do you want to upgrade ARK Server Tools to v${arkstLatestVersion}?" -n 1 -r
|
read -p "A new version was found! Do you want to upgrade ARK Server Tools to v${arkstLatestVersion}?" -n 1 -r
|
||||||
echo -en "\n"
|
echo -en "\n"
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
arkstChannel="master" # change it to a different branch to get non-stable versions
|
arkstChannel="master" # change it to a different branch to get non-stable versions
|
||||||
install_bindir="/usr/bin"
|
install_bindir="/usr/bin"
|
||||||
install_libexecdir="/usr/libexec/arkmanager"
|
install_libexecdir="/usr/libexec/arkmanager"
|
||||||
|
install_datadir="/usr/share/arkmanager"
|
||||||
|
|
||||||
# config SteamCMD
|
# config SteamCMD
|
||||||
steamcmdroot="/home/steam/steamcmd" # path of your steamcmd instance
|
steamcmdroot="/home/steam/steamcmd" # path of your steamcmd instance
|
||||||
|
|||||||
@ -28,6 +28,13 @@ while [ -n "$1" ]; do
|
|||||||
EXECPREFIX="$2"
|
EXECPREFIX="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--data-prefix=*)
|
||||||
|
DATAPREFIX="${1#--data-prefix=}"
|
||||||
|
;;
|
||||||
|
--data-prefix)
|
||||||
|
DATAPREFIX="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--install-root=*)
|
--install-root=*)
|
||||||
INSTALL_ROOT="${1#--install-root=}"
|
INSTALL_ROOT="${1#--install-root=}"
|
||||||
;;
|
;;
|
||||||
@ -49,6 +56,13 @@ while [ -n "$1" ]; do
|
|||||||
LIBEXECDIR="$2"
|
LIBEXECDIR="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--datadir=*)
|
||||||
|
DATADIR="${1#--datadir=}"
|
||||||
|
;;
|
||||||
|
--datadir)
|
||||||
|
DATADIR="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo "Invalid option '$1'"
|
echo "Invalid option '$1'"
|
||||||
showusage=yes
|
showusage=yes
|
||||||
@ -84,13 +98,16 @@ fi
|
|||||||
if [ "$userinstall" == "yes" ]; then
|
if [ "$userinstall" == "yes" ]; then
|
||||||
PREFIX="${PREFIX:-${HOME}}"
|
PREFIX="${PREFIX:-${HOME}}"
|
||||||
EXECPREFIX="${EXECPREFIX:-${PREFIX}}"
|
EXECPREFIX="${EXECPREFIX:-${PREFIX}}"
|
||||||
|
DATAPREFIX="${DATAPREFIX:-${PREFIX}/.local/share}"
|
||||||
else
|
else
|
||||||
PREFIX="${PREFIX:-/usr/local}"
|
PREFIX="${PREFIX:-/usr/local}"
|
||||||
EXECPREFIX="${EXECPREFIX:-${PREFIX}}"
|
EXECPREFIX="${EXECPREFIX:-${PREFIX}}"
|
||||||
|
DATAPREFIX="${DATAPREFIX:-${PREFIX}/share}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BINDIR="${BINDIR:-${EXECPREFIX}/bin}"
|
BINDIR="${BINDIR:-${EXECPREFIX}/bin}"
|
||||||
LIBEXECDIR="${LIBEXECDIR:-${EXECPREFIX}/libexec/arkmanager}"
|
LIBEXECDIR="${LIBEXECDIR:-${EXECPREFIX}/libexec/arkmanager}"
|
||||||
|
DATADIR="${DATADIR:-${DATAPREFIX}/arkmanager}"
|
||||||
|
|
||||||
if [ "$showusage" == "yes" ]; then
|
if [ "$showusage" == "yes" ]; then
|
||||||
echo "Usage: ./install.sh {<user>|--me} [OPTIONS]"
|
echo "Usage: ./install.sh {<user>|--me} [OPTIONS]"
|
||||||
@ -106,11 +123,16 @@ if [ "$showusage" == "yes" ]; then
|
|||||||
echo " [PREFIX=${PREFIX}]"
|
echo " [PREFIX=${PREFIX}]"
|
||||||
echo "--exec-prefix Specify the prefix under which to install executables"
|
echo "--exec-prefix Specify the prefix under which to install executables"
|
||||||
echo " [EXECPREFIX=${EXECPREFIX}]"
|
echo " [EXECPREFIX=${EXECPREFIX}]"
|
||||||
|
echo "--data-prefix Specify the prefix under which to install suppor files"
|
||||||
|
echo " [DATAPREFIX=${DATAPREFIX}]"
|
||||||
echo "--install-root Specify the staging directory in which to perform the install"
|
echo "--install-root Specify the staging directory in which to perform the install"
|
||||||
echo " [INSTALL_ROOT=${INSTALL_ROOT}]"
|
echo " [INSTALL_ROOT=${INSTALL_ROOT}]"
|
||||||
echo "--bindir Specify the directory under which to install executables"
|
echo "--bindir Specify the directory under which to install executables"
|
||||||
echo " [BINDIR=${BINDIR}]"
|
echo " [BINDIR=${BINDIR}]"
|
||||||
echo "--libexecdir Specify the directory under which to install executable support files"
|
echo "--libexecdir Specify the directory under which to install executable support files"
|
||||||
|
echo " [LIBEXECDIR=${LIBEXECDIR}]"
|
||||||
|
echo "--datadir Specify the directory under which to install support files"
|
||||||
|
echo " [DATADIR=${DATADIR}]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -131,6 +153,7 @@ if [ "$userinstall" == "yes" ]; then
|
|||||||
-e "s|/var/log/arktools|${PREFIX}/logs/arktools|" \
|
-e "s|/var/log/arktools|${PREFIX}/logs/arktools|" \
|
||||||
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
||||||
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
||||||
|
-e "s|^install_datadir=.*|install_datadir=\"${DATADIR}\"|" \
|
||||||
"${INSTALL_ROOT}${PREFIX}/.arkmanager.cfg.NEW"
|
"${INSTALL_ROOT}${PREFIX}/.arkmanager.cfg.NEW"
|
||||||
|
|
||||||
# Copy arkmanager.cfg to ~/.arkmanager.cfg if it doesn't already exist
|
# Copy arkmanager.cfg to ~/.arkmanager.cfg if it doesn't already exist
|
||||||
@ -233,6 +256,7 @@ else
|
|||||||
-e "s|\"/home/steam|\"/home/$1|" \
|
-e "s|\"/home/steam|\"/home/$1|" \
|
||||||
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
||||||
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
||||||
|
-e "s|^install_datadir=.*|install_datadir=\"${DATADIR}\"|" \
|
||||||
"${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg"
|
"${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg"
|
||||||
|
|
||||||
if [ -f "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" ]; then
|
if [ -f "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user