Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import os
- import os.path
- steam_cmd = "/home/steam/arma3/steam/steamcmd.sh"
- steam_cmd_params = ""
- steam_user = ""
- steam_pass = ""
- a3_server_id = "233780"
- a3_server_dir = "/home/steam/arma3/install"
- a3_workshop_id = "107410"
- a3_workshop_dir = "/home/steam/arma3/steam/steamapps/workshop/content/{}".format(a3_workshop_id)
- a3_mods_dir = "/home/steam/arma3/mods"
- mods = {
- "@cba_a3": "450814997",
- #"@ace3": "463939057",
- #"@alive": "620260972",
- "@cup_terrains_core": "583496184",
- "@cup_terrains_maps": "583544987",
- #"@cup_weapons": "497660133",
- #"@cup_units": "497661914",
- #"@cup_vehicles": "541888371",
- #"@ifa3lite": "660460283",
- #"@bloodlust": "667953829",
- #"@us_military_mod_a3": "579942493",
- #"@project_opfor": "735566597",
- #"@beketov_a3": "743968516",
- "@rhsafrf": "843425103",
- "@rhsusaf": "843577117",
- "@rhsgref": "843593391",
- "@rhssaf": "843632231",
- "@xla_fixedarsenal": "437407341"
- }
- steam_cmd_params += " +login {} {}".format(steam_user, steam_pass)
- steam_cmd_params += " +force_install_dir {}".format(a3_server_dir)
- steam_cmd_params += " +app_update {} validate".format(a3_server_id)
- for key, value in mods.items():
- steam_cmd_params += " +workshop_download_item {} {} validate".format(
- a3_workshop_id,
- value
- )
- steam_cmd_params += " +quit"
- os.system("{} {}".format(steam_cmd, steam_cmd_params))
- print("")
- print("=========")
- print("Converting uppercase files/folders to lowercase...")
- os.system("find {} -depth -exec rename -v 's/(.*)\/([^\/]*)/$1\/\L$2/' {{}} \;".format(a3_workshop_dir))
- print("Creating symlinks...")
- for key, value in mods.items():
- link_path = "{}/{}".format(a3_mods_dir, key)
- real_path = "{}/{}".format(a3_workshop_dir, value)
- if os.path.isdir(real_path):
- if not os.path.islink(link_path):
- os.symlink(real_path, link_path)
- print("Creating symlink '{}'...".format(link_path))
- else:
- print("Symlink '{}' already exists! ({})".format(key, link_path))
- else:
- print("Mod '{}' does not exist! ({})".format(key, real_path))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement