New save game script
Check if remote_dir and steam_id dir exists.
This commit is contained in:
		
							parent
							
								
									656c9c3ba0
								
							
						
					
					
						commit
						a123598f2a
					
				|  | @ -0,0 +1,31 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| # Vars {{{ | ||||
| remote_dir="${HOME}/Nextcloud/games/linux.sgl.script" | ||||
| 
 | ||||
| steam_id="1" | ||||
| steam_userdata="${HOME}/.steam/steam/userdata/${steam_id}" | ||||
| # }}} | ||||
| 
 | ||||
| # Tests {{{ | ||||
| 
 | ||||
| ## Ensure remote dir exist {{{ | ||||
| if [ ! -d "${remote_dir}" ]; then | ||||
| 	printf '\e[1;35m%-6s\e[m\n' "The directory for save game doesn't exists : ${remote_dir}" | ||||
| 	exit 1 | ||||
| fi | ||||
| ## }}} | ||||
| ## Ensure Steam dir exist {{{ | ||||
| if [ ! -d "${steam_userdata}" ]; then | ||||
| 	printf '\e[1;35m%-6s\e[m\n' "The Steam directory for your ID (${steam_id}) doesn't exists yet… Should it must be create (for restoration,…) [Y/n] ?" | ||||
| 	read -r create_steam_userdata | ||||
| 	if [ "${create_steam_userdata}" = "" ] || [ "${create_steam_userdata}" = "Y" ] || [ "${create_steam_userdata}" = "y" ]; then | ||||
| 		mkdir -p -- "${steam_userdata}" | ||||
| 	else | ||||
| 		printf '\e[1;35m%-6s\e[m\n' "Steam directory doesn't exists, abort script." | ||||
| 		exit 2 | ||||
| 	fi | ||||
| fi | ||||
| ## }}} | ||||
| 
 | ||||
| # }}} | ||||
		Loading…
	
		Reference in New Issue