Upload files to "Rimworld-Together"
This commit is contained in:
		
							parent
							
								
									112ac0c40b
								
							
						
					
					
						commit
						5299f7a6c3
					
				
					 1 changed files with 51 additions and 0 deletions
				
			
		
							
								
								
									
										51
									
								
								Rimworld-Together/one-off-mod-dl.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								Rimworld-Together/one-off-mod-dl.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,51 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
# Path to the SteamCMD executable
 | 
			
		||||
STEAMCMD_PATH="/opt/steamcmd/steamcmd.sh"
 | 
			
		||||
 | 
			
		||||
# Path to the directory where you want to install the workshop items
 | 
			
		||||
#mods will be in $INSTALL_DIR/steamapps/workshop/content/$APP_ID/$workshop_id/
 | 
			
		||||
INSTALL_DIR="/home/rimworld/optional-mods"
 | 
			
		||||
 | 
			
		||||
# AppID for the game (replace with the appropriate AppID)
 | 
			
		||||
APP_ID="294100"  
 | 
			
		||||
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ -z "$1" ]; then
 | 
			
		||||
    echo
 | 
			
		||||
    redecho "Workshop ID needs to be \$1"
 | 
			
		||||
    echo
 | 
			
		||||
    exit
 | 
			
		||||
else
 | 
			
		||||
    blueecho "WorkshopID is: $1"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### request php compatability section
 | 
			
		||||
steamWorkshopLink="$@"
 | 
			
		||||
 | 
			
		||||
# Extracting the Workshop ID using sed
 | 
			
		||||
workshopID=$(echo "$steamWorkshopLink" | sed 's/.*id=\([0-9]*\).*/\1/')
 | 
			
		||||
 | 
			
		||||
# Displaying the extracted Workshop ID
 | 
			
		||||
echo "Workshop ID: $workshopID"
 | 
			
		||||
 | 
			
		||||
# Do the DL
 | 
			
		||||
"$STEAMCMD_PATH" +force_install_dir "$INSTALL_DIR" +login anonymous +workshop_download_item "$APP_ID" "$workshopID" +quit
 | 
			
		||||
#### end request php compatability section
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
"$STEAMCMD_PATH" +force_install_dir "$INSTALL_DIR" +login anonymous +workshop_download_item "$APP_ID" "$1" +quit
 | 
			
		||||
echo "Download Complete"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# This should be handled better, i got lazy
 | 
			
		||||
# should have ln -s the steam DL dir instead of moving, opps
 | 
			
		||||
/usr/bin/rsync -av --delete /home/rimworld/optional-mods/steamapps/workshop/content/294100/* /home/rimworld/Mods/Optional/
 | 
			
		||||
cp -r /home/rimworld/optional-mods/steamapps/workshop/content/294100/* /home/rimworld/Mods/Optional/
 | 
			
		||||
/usr/bin/rm -rf /home/rimworld/optional-mods/steamapps/workshop/content/294100/*
 | 
			
		||||
 | 
			
		||||
# DL sometimes done by www because of request form
 | 
			
		||||
/usr/bin/chmod -R 444 /home/rimworld/Mods/Optional/
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue