Add Factorio (vultr) server
This commit is contained in:
parent
6e16dd7162
commit
b74fc406d5
6 changed files with 104 additions and 0 deletions
13
factorio/install_mods.sh
Executable file
13
factorio/install_mods.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p bash curl jq
|
||||
mods="Krastorio2 Krastorio2Assets flib Big_Brother AtomicArtillery AutoDeconstruct nixie-tubes"
|
||||
download_dir=./mods
|
||||
username=$(cat ../keys.toml | grep factorio-username | cut -d'"' -f2)
|
||||
token=$(cat ../keys.toml | grep factorio-token | cut -d'"' -f2)
|
||||
for mod in $mods; do
|
||||
mod_data=$(curl -s https://mods.factorio.com/api/mods/$mod)
|
||||
download_url=$(<<<$mod_data jq -r ".releases[-1].download_url")
|
||||
file_name=$(<<<$mod_data jq -r ".releases[-1].file_name")
|
||||
sha1=$(<<<$mod_data jq -r ".releases[-1].sha1") # TODO
|
||||
[ -f $download_dir/$file_name ] || curl --location --no-clobber --output $download_dir/$file_name "https://mods.factorio.com/$download_url?username=$username&token=$token"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue