bcserv/sourcemod-updater

语言: Shell

git: https://github.com/bcserv/sourcemod-updater

更新或安装sourcemod
Updates or installs sourcemod
README.md (中文)

Sourcemod更新程序

更新或安装最新的Sourcemod稳定版或快照。

alt text

特征

  • 安装/更新稳定版本或快照
  • 自定义文件和插件不会被覆盖(除了您修改了核心文件)
  • 不会触及配置(您必须自己更新)
  • 下载的软件包将被缓存,下次不会下载
  • 之后可以修复权限(--fixpermissions)

安装

# Change to any directory where you want to install it first
aptitude install lynx wget findutils rsync
wget https://github.com/bcserv/sourcemod-updater/archive/master.zip -O sourcemod-updater.zip
unzip sourcemod-updater.zip
mv sourcemod-updater-master sourcemod-updater
cd sourcemod-updater
chmod u+x update.sh
chmod u+w packagecache
./update.sh

用法

句法

./update.sh <game_dir> [<optional Package URL>] --snapshot-stable --snapshot-dev --install --dontask --fixpermissions

选项

--snapshot稳定

更新或安装最新的Sourcemod STABLE快照。

--snapshot-dev的

更新或安装最新的Sourcemod DEV快照。

- 安装

安装sourcemod而不是更新。 小心:这将覆盖任何现有的sourcemod文件。

--dontask

执行期间从不要求任何东西。 这会影响未找到包URL的情况或 继续更新之前的安全检查

- 修复权限

更新后读取srcds的所有者和游戏目录组 并将它们递归地应用于sourcemod文件。 如果更新由root执行且srcds不以root身份运行,则需要这样做。

--smdir

为addons / sourcemod目录设置备用名称。 如果您使用srcds forks并需要多个sourcemod安装, 你必须设置这个。

例子

./update.sh /game/css/cstrike

./update.sh /srcds/css/cstrike --install --fixpermissions # Install sourcemod and fix the file permissions afterwards
./update.sh /srcds/css/cstrike --snapshot-stable          # Update sourcemod to the latest STABLE snapshot
./update.sh /srcds/css/cstrike --snapshot-dev             # Update sourcemod to the latest DEV snapshot
./update.sh /srcds/css/cstrike --dontask                  # Never ask for anything

更新行为

  • bin - 完全替换
  • configs - 替换geoip和sql-init-scripts,不触及任何其他内容
  • 数据 - 没有触及
  • 扩展 - 覆盖核心文件;不会触及自定义文件
  • gamedata - 完全取代core.games/,sdktools.games/和sm - * .txt文件
  • 日志 - 没有碰过
  • 插件 - 覆盖核心文件;不会触及自定义文件;新的核心插件去禁用/
  • 脚本 - 覆盖核心文件;不会触及自定义文件
  • 翻译 - 覆盖核心文件;不会触及自定义文件

完全替换还意味着删除不在更新包中的文件

设置

# The source code of this page will be searched for the latest sourcemod package
# We assume that the last one is the latest
STABLE_MIRROR="http://sourcemod.steamfriends.com/files/"
STABLE_SEARCHPATTER="http:.*sourcemod.*linux.*"

SNAPSHOT_STABLE_MIRROR="http://www.sourcemod.net/smdrop/1.4/"
SNAPSHOT_STABLE_SEARCHPATTER="http:.*sourcemod-.*-linux.*"

SNAPSHOT_DEV_MIRROR="http://www.sourcemod.net/smdrop/1.5/"
SNAPSHOT_DEV_SEARCHPATTER="http:.*sourcemod-.*-linux.*"

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Sourcemod updater

Updates or installs the latest Sourcemod stable release or snapshots.

alt text

Features

  • Installs/updates stable releases or snapshots
  • Custom files and plugins won't get overwritten (except you modified core files)
  • Configuration will not be touched (You have to update them yourself)
  • Downloaded packages will be cached and not downloaded the next time
  • Can fix the permission afterwards (--fixpermissions)

Installation

# Change to any directory where you want to install it first
aptitude install lynx wget findutils rsync
wget https://github.com/bcserv/sourcemod-updater/archive/master.zip -O sourcemod-updater.zip
unzip sourcemod-updater.zip
mv sourcemod-updater-master sourcemod-updater
cd sourcemod-updater
chmod u+x update.sh
chmod u+w packagecache
./update.sh

Usage

Syntax

./update.sh <game_dir> [<optional Package URL>] --snapshot-stable --snapshot-dev --install --dontask --fixpermissions

Options

--snapshot-stable

Updates or installs the latest Sourcemod STABLE snapshot.

--snapshot-dev

Updates or installs the latest Sourcemod DEV snapshot.

--install

Installs sourcemod instead of updating.
CAUTION: this will overwrite any existing sourcemod files.

--dontask

Never ask for anything during execution.
This affects the situation when no package URL was found or
the security check before continuing the update

--fixpermissions

Reads the owner and the group of the game directory of the srcds after the update
and applies them recursively to the sourcemod files.
This is needed if the update is executed by root and the srcds doesn't run as root.

--smdir

Sets an alternative name for the addons/sourcemod directory.
If you are using srcds forks and need multiple sourcemod installations,
you have to set this.

Examples

./update.sh /game/css/cstrike

./update.sh /srcds/css/cstrike --install --fixpermissions # Install sourcemod and fix the file permissions afterwards
./update.sh /srcds/css/cstrike --snapshot-stable          # Update sourcemod to the latest STABLE snapshot
./update.sh /srcds/css/cstrike --snapshot-dev             # Update sourcemod to the latest DEV snapshot
./update.sh /srcds/css/cstrike --dontask                  # Never ask for anything

Behavior on updating

  • bin - full replace
  • configs - replaces geoip and sql-init-scripts, doesn't touch anything else
  • data - not touched
  • extensions - overwrites core files; custom files won't be touched
  • gamedata - fully replaces core.games/, sdktools.games/ and sm-*.txt files
  • logs - not touched
  • plugins - overwrites core files; custom files won't be touched; new core plugins go to disabled/
  • scripting - overwrites core files; custom files won't be touched
  • translations - overwrites core files; custom files won't be touched

full replace means also deleting files that are not in the update package

Settings

# The source code of this page will be searched for the latest sourcemod package
# We assume that the last one is the latest
STABLE_MIRROR="http://sourcemod.steamfriends.com/files/"
STABLE_SEARCHPATTER="http:.*sourcemod.*linux.*"

SNAPSHOT_STABLE_MIRROR="http://www.sourcemod.net/smdrop/1.4/"
SNAPSHOT_STABLE_SEARCHPATTER="http:.*sourcemod-.*-linux.*"

SNAPSHOT_DEV_MIRROR="http://www.sourcemod.net/smdrop/1.5/"
SNAPSHOT_DEV_SEARCHPATTER="http:.*sourcemod-.*-linux.*"