From a032348bd89b392e64fd19a409479fa78e9c583d Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 30 Mar 2015 15:57:41 -0400 Subject: [PATCH] adding bethesda games wine game saver. definitely not intended for the masses. --- customizing/fred/scripts/gamesaver.sh | 20 ++++++++++++++++++++ scripts/archival/unpack.sh | 19 +++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 customizing/fred/scripts/gamesaver.sh diff --git a/customizing/fred/scripts/gamesaver.sh b/customizing/fred/scripts/gamesaver.sh new file mode 100644 index 00000000..88a4cb13 --- /dev/null +++ b/customizing/fred/scripts/gamesaver.sh @@ -0,0 +1,20 @@ + +# hmmm: some better work could be done to have both names (wineprefix and storage dir) be iterable. +for i in oblivion fallout_new_vegas fallout_3 skyrim ; do + if [ ! -d $HOME/spooling_saves_$i ]; then + mkdir $HOME/spooling_saves_$i + fi +done +echo "=======" +echo skyrim +cp -v -n ~/My\ Games/Skyrim/Saves/* ~/spooling_saves_skyrim +echo "=======" +echo fallout new vegas +cp -v -n ~/My\ Games/FalloutNV/Saves/* ~/spooling_saves_fallout_new_vegas/ +echo "=======" +echo fallout 3 +cp -v -n ~/My\ Games/Fallout3/Saves/Player1/* ~/spooling_saves_fallout_3 +echo "=======" +echo oblivion +cp -v -n ~/My\ Games/Oblivion/Saves/* ~/spooling_saves_oblivion/ +echo "=======" diff --git a/scripts/archival/unpack.sh b/scripts/archival/unpack.sh index cffb90e2..3fca182d 100644 --- a/scripts/archival/unpack.sh +++ b/scripts/archival/unpack.sh @@ -11,7 +11,7 @@ ############## # # An arbitrary format archive unpacker, although really we are mainly supporting -# tar and zip currently, including compressed formats. +# tar, zip, 7z, and rar at this time. archive_file="$1"; shift if [ -z "$archive_file" ]; then @@ -52,6 +52,13 @@ if [ ! -f "$archive_file" ]; then fi fi +#hmmm: we could log to a file and spew the file if there's a failure, then +# remove the file after spewing or after successful run. +# this is a really commonly repeated pattern that would be nice to support +# in general. + +# record what happened. +save_err=1 if [[ "$archive_file" =~ .*\.tar$ \ || "$archive_file" =~ .*\.tar\.gz$ \ || "$archive_file" =~ .*\.tar\.bz2$ \ @@ -62,6 +69,7 @@ if [[ "$archive_file" =~ .*\.tar$ \ || "$archive_file" =~ .*\.snarf$ \ ]]; then tar -xf "$archive_file" &>/dev/null + save_err=$? elif [[ "$archive_file" =~ .*\.zip$ \ || "$archive_file" =~ .*\.epub$ \ || "$archive_file" =~ .*\.odt$ \ @@ -69,11 +77,14 @@ elif [[ "$archive_file" =~ .*\.zip$ \ || "$archive_file" =~ .*\.war$ \ ]]; then unzip "$archive_file" &>/dev/null -elif [[ "$archive_file" =~ .*\.7z$ \ - ]]; then + save_err=$? +elif [[ "$archive_file" =~ .*\.7z$ ]]; then 7z x "$archive_file" &>/dev/null + save_err=$? +elif [[ "$archive_file" =~ .*\.rar$ ]]; then + rar x "$archive_file" &>/dev/null + save_err=$? fi -save_err=$? popd &>/dev/null -- 2.34.1