Replace dirty web crawl with glorious simplicity

This commit is contained in:
Lucas Desgouilles 2019-06-13 13:32:59 +02:00 committed by GitHub
commit 472ee10b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,16 +1,19 @@
#!/bin/bash #!/bin/bash
cd $HOME/hlserver/tf2/tf cd $HOME/hlserver/tf2/tf
mm_url=$(wget -q -O - "https://www.metamodsource.net/downloads.php?branch=dev" | grep -oP -m1 "https://[a-z.]+/mmsdrop/[0-9.]+/mmsource-(.*)-linux.tar.gz") mm_drop="https://mms.alliedmods.net/mmsdrop/1.10"
sm_url=$(wget -q -O - "http://www.sourcemod.net/downloads.php?branch=dev" | grep -oP -m1 "https://[a-z.]+/smdrop/[0-9.]+/sourcemod-(.*)-linux.tar.gz") sm_drop="https://sm.alliedmods.net/smdrop/1.9"
wget -nv $mm_url mm_latest=$(wget -q -O - "$mm_drop/mmsource-latest-linux")
wget -nv $sm_url sm_latest=$(wget -q -O - "$sm_drop/sourcemod-latest-linux")
tar -xvzf mmsource-*-linux.tar.gz wget -nv "$mm_drop/$mm_latest"
tar -xvzf sourcemod-*-linux.tar.gz wget -nv "$sm_drop/$sm_latest"
rm *.tar.gz tar -xvzf "$mm_latest"
tar -xvzf "$sm_latest"
rm "$mm_latest" "$sm_latest"
# prevent automatic map switch # prevent automatic map switch
rm addons/sourcemod/plugins/{nextmap.smx,funcommands.smx,funvotes.smx} rm addons/sourcemod/plugins/{nextmap.smx,funcommands.smx,funvotes.smx}