mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-12 02:48:27 +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_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
|
||||
arkstVersion="1.3"
|
||||
arkstCommit=''
|
||||
@ -985,6 +991,9 @@ doUpgrade() {
|
||||
if [ -n "$install_libexecdir" ]; then
|
||||
reinstall_args=( "${reinstall_args[@]}" "--libexecdir" "$install_libexecdir" )
|
||||
fi
|
||||
if [ -n "$install_datadir" ]; then
|
||||
reinstall_args=( "${reinstall_args[@]}" "--datadir" "$install_datadir" )
|
||||
fi
|
||||
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
|
||||
echo -en "\n"
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
arkstChannel="master" # change it to a different branch to get non-stable versions
|
||||
install_bindir="/usr/bin"
|
||||
install_libexecdir="/usr/libexec/arkmanager"
|
||||
install_datadir="/usr/share/arkmanager"
|
||||
|
||||
# config SteamCMD
|
||||
steamcmdroot="/home/steam/steamcmd" # path of your steamcmd instance
|
||||
|
||||
@ -28,6 +28,13 @@ while [ -n "$1" ]; do
|
||||
EXECPREFIX="$2"
|
||||
shift
|
||||
;;
|
||||
--data-prefix=*)
|
||||
DATAPREFIX="${1#--data-prefix=}"
|
||||
;;
|
||||
--data-prefix)
|
||||
DATAPREFIX="$2"
|
||||
shift
|
||||
;;
|
||||
--install-root=*)
|
||||
INSTALL_ROOT="${1#--install-root=}"
|
||||
;;
|
||||
@ -49,6 +56,13 @@ while [ -n "$1" ]; do
|
||||
LIBEXECDIR="$2"
|
||||
shift
|
||||
;;
|
||||
--datadir=*)
|
||||
DATADIR="${1#--datadir=}"
|
||||
;;
|
||||
--datadir)
|
||||
DATADIR="$2"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
echo "Invalid option '$1'"
|
||||
showusage=yes
|
||||
@ -84,13 +98,16 @@ fi
|
||||
if [ "$userinstall" == "yes" ]; then
|
||||
PREFIX="${PREFIX:-${HOME}}"
|
||||
EXECPREFIX="${EXECPREFIX:-${PREFIX}}"
|
||||
DATAPREFIX="${DATAPREFIX:-${PREFIX}/.local/share}"
|
||||
else
|
||||
PREFIX="${PREFIX:-/usr/local}"
|
||||
EXECPREFIX="${EXECPREFIX:-${PREFIX}}"
|
||||
DATAPREFIX="${DATAPREFIX:-${PREFIX}/share}"
|
||||
fi
|
||||
|
||||
BINDIR="${BINDIR:-${EXECPREFIX}/bin}"
|
||||
LIBEXECDIR="${LIBEXECDIR:-${EXECPREFIX}/libexec/arkmanager}"
|
||||
DATADIR="${DATADIR:-${DATAPREFIX}/arkmanager}"
|
||||
|
||||
if [ "$showusage" == "yes" ]; then
|
||||
echo "Usage: ./install.sh {<user>|--me} [OPTIONS]"
|
||||
@ -106,11 +123,16 @@ if [ "$showusage" == "yes" ]; then
|
||||
echo " [PREFIX=${PREFIX}]"
|
||||
echo "--exec-prefix Specify the prefix under which to install executables"
|
||||
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=${INSTALL_ROOT}]"
|
||||
echo "--bindir Specify the directory under which to install executables"
|
||||
echo " [BINDIR=${BINDIR}]"
|
||||
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
|
||||
fi
|
||||
|
||||
@ -131,6 +153,7 @@ if [ "$userinstall" == "yes" ]; then
|
||||
-e "s|/var/log/arktools|${PREFIX}/logs/arktools|" \
|
||||
-e "s|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
||||
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
||||
-e "s|^install_datadir=.*|install_datadir=\"${DATADIR}\"|" \
|
||||
"${INSTALL_ROOT}${PREFIX}/.arkmanager.cfg.NEW"
|
||||
|
||||
# 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|^install_bindir=.*|install_bindir=\"${BINDIR}\"|" \
|
||||
-e "s|^install_libexecdir=.*|install_libexecdir=\"${LIBEXECDIR}\"|" \
|
||||
-e "s|^install_datadir=.*|install_datadir=\"${DATADIR}\"|" \
|
||||
"${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg"
|
||||
|
||||
if [ -f "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" ]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user