Browse Source

lint

pull/4403/head
Daniel Gibbs 1 year ago
parent
commit
cb5bca9573
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 10
      lgsm/modules/fix_vh.sh
  2. 10
      lgsm/modules/info_distro.sh

10
lgsm/modules/fix_vh.sh

@ -18,11 +18,11 @@ if [ -f "${modsinstalledlistfullpath}" ]; then
executable="./start_server_bepinex.sh" executable="./start_server_bepinex.sh"
fi fi
if [ -d "${serverfiles}/unstripped_corlib" ]; then if [ -d "${serverfiles}/unstripped_corlib" ]; then
rm -rf "${serverfiles}/unstripped_corlib" rm -rf "${serverfiles}/unstripped_corlib"
fi fi
sed -i 's/^dllSearchPathOverride=unstripped_corlib/# &/' "${serverfiles}/doorstop_config.ini" sed -i "s/^dllSearchPathOverride=unstripped_corlib/# &/" "${serverfiles}/doorstop_config.ini"
sed -i 's/^export DOORSTOP_CORLIB_OVERRIDE_PATH="$BASEDIR\/unstripped_corlib"/# &/' "${serverfiles}/start_game_bepinex.sh" sed -i "s/^export DOORSTOP_CORLIB_OVERRIDE_PATH="$BASEDIR\/unstripped_corlib"/# &/" "${serverfiles}/start_game_bepinex.sh"
sed -i 's/^export DOORSTOP_CORLIB_OVERRIDE_PATH="${VALHEIM_PLUS_PATH}\/unstripped_corlib"/# &/' "${serverfiles}/start_server_bepinex.sh" sed -i "s/^export DOORSTOP_CORLIB_OVERRIDE_PATH="${VALHEIM_PLUS_PATH}\/unstripped_corlib"/# &/" "${serverfiles}/start_server_bepinex.sh"
fi fi
# special exports for BepInEx if installed # special exports for BepInEx if installed
if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then

10
lgsm/modules/info_distro.sh

@ -28,15 +28,15 @@ kernel="$(uname -r)" # Kernel e.g. 2.6.32-042stab120.16
distro_info_array=(os-release lsb_release hostnamectl debian_version redhat-release) distro_info_array=(os-release lsb_release hostnamectl debian_version redhat-release)
for distro_info in "${distro_info_array[@]}"; do for distro_info in "${distro_info_array[@]}"; do
if [ -f "/etc/os-release" ] && [ "${distro_info}" == "os-release" ]; then if [ -f "/etc/os-release" ] && [ "${distro_info}" == "os-release" ]; then
distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" # e.g. Ubuntu 22.04.3 LTS distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. Ubuntu 22.04.3 LTS
distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" # e.g. 22.04 distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. 22.04
# Special var for rhel like distros to remove point in number e.g 8.4 to just 8. # Special var for rhel like distros to remove point in number e.g 8.4 to just 8.
if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then
distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" # e.g. 8 distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" # e.g. 8
fi fi
distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" # e.g. ubuntu distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. ubuntu
distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" # e.g. debian distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. debian
distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" # e.g. jammy distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. jammy
elif [ "$(command -v lsb_release 2> /dev/null)" ] && [ "${distro_info}" == "lsb_release" ]; then elif [ "$(command -v lsb_release 2> /dev/null)" ] && [ "${distro_info}" == "lsb_release" ]; then
if [ -z "${distroname}" ]; then if [ -z "${distroname}" ]; then
distroname="$(lsb_release -sd)" # e.g. Ubuntu 22.04.3 LTS distroname="$(lsb_release -sd)" # e.g. Ubuntu 22.04.3 LTS

Loading…
Cancel
Save