ASF一键安装脚本

此脚本可以一键安装ArchiSteamFarm,适用于Ubuntu/Debian,已经在Ubuntu18.04下通过测试。

源代码

#!/usr/bin/sh
# Author:  Jianrry
# Version: 0.1

# the download link of ArchiSteamFarm
ASF_Download_Link="https://github.com/JustArchiNET/ArchiSteamFarm/releases/download/4.0.2.7/ASF-linux-x64.zip"
# the install folder of ArchiSteamFarm
ASF_Install_Folder="/opt/asf"


# if the user isn't root, it will exit
Check_Root() {
if [ "$(id -u)" != 0 ];then
        echo -e "当前用户不是root,无法进行下一步操作,请输入su切换到root用户后继续"
        exit
fi
}


# install the dependencies
Install_Dependencies() {
    apt-get update && apt-get -y install wget unzip sudo libicu-dev screen
}


# install ArchiSteamFarm
Install_ArchiSteamFarm() {
    # download ArchiSteamFarm
    wget -O ASF.zip $ASF_Download_Link
    # unzip ArchiSteamFarm
    unzip ASF.zip -d $ASF_Install_Folder
    # chmod +x ArchiSteamFarm
    chmod +x $ASF_Install_Folder/ArchiSteamFarm
}

# deploy ArchiSteamFarm
Deploy_ArchiSteamFarm() {
    echo "请输入您的 64 位 SteamID"
    read SteamID
    touch $ASF_Install_Folder/config/ASF.json
    echo -e "{
    "\"s_SteamMasterClanID\"": "\"$SteamID\""}" > $ASF_Install_Folder/config/ASF.json

    echo "请输入您的 Steam 帐户用户名"
    read SteamLogin
    echo "请输入您的 Steam 帐户密码"
    read SteamPassword
    touch $ASF_Install_Folder/config/Bot.json
    echo -e "{
    "\"Enabled\"": true,
    "\"SteamLogin\"": "\"$SteamLogin\"",
    "\"SteamPassword\"": "\"$SteamPassword\""}" > $ASF_Install_Folder/config/Bot.json
}

# run ArchiSteamFarm
Run_ArchiSteamFarm() {
    # enter the install folder of ArchiSteamFarm
    cd $ASF_Install_Folder
    # run ArchiSteamFarm
    ./ArchiSteamFarm

}

Check_Root
Install_Dependencies
Install_ArchiSteamFarm
Deploy_ArchiSteamFarm
Run_ArchiSteamFarm

最后修改:2019 年 07 月 20 日 04 : 23 PM
如果觉得我的文章对你有用,请随意赞赏

发表评论