small security changes
This commit is contained in:
+11
-8
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
search_paths=("$HOME/.steam/steam/steamapps/common" "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common" "$HOME/.local/share/Steam/steamapps/common" "/mnt" "/")
|
search_paths=("$HOME/.steam/steam/steamapps/common" "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common" "$HOME/.local/share/Steam/steamapps/common" "/mnt" "/")
|
||||||
repository_url="https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest"
|
repository_url="https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest"
|
||||||
@@ -10,11 +11,11 @@ read -p "Do you want to use the official Github-Repository [d] to download the m
|
|||||||
|
|
||||||
if [[ $input == "l" || $input == "L" || $input == "local" || $input == "Local" ]]; then
|
if [[ $input == "l" || $input == "L" || $input == "local" || $input == "Local" ]]; then
|
||||||
echo "Searching Downloads folder..."
|
echo "Searching Downloads folder..."
|
||||||
local_path=$(timeout 5 find $HOME/Downloads -iname Seamless*.zip) || true
|
local_path=$(timeout 5 find "$HOME/Downloads" -iname Seamless*.zip) || true
|
||||||
|
|
||||||
if [[ -f "$local_path" && "$local_path" =~ ^.*Seamless.*.zip$ ]]; then
|
if [[ -f "$local_path" && "$local_path" =~ ^.*Seamless.*\.zip$ ]]; then
|
||||||
echo "File found at $local_path"
|
echo "File found at $local_path"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "File not found in $HOME/Downloads"
|
echo "File not found in $HOME/Downloads"
|
||||||
read -p "Please specify the path to your local .zip archive: " input
|
read -p "Please specify the path to your local .zip archive: " input
|
||||||
@@ -27,7 +28,7 @@ if [[ $input == "l" || $input == "L" || $input == "local" || $input == "Local" ]
|
|||||||
echo "File found at $local_path"
|
echo "File found at $local_path"
|
||||||
|
|
||||||
elif [[ ! -z "$input" ]]; then
|
elif [[ ! -z "$input" ]]; then
|
||||||
local_path=$(timeout 5 find $input -iname Seamless*.zip)
|
local_path=$(timeout 5 find "$input" -iname Seamless*.zip)
|
||||||
if [[ -f "$local_path" ]]; then
|
if [[ -f "$local_path" ]]; then
|
||||||
echo "File found at $local_path"
|
echo "File found at $local_path"
|
||||||
else
|
else
|
||||||
@@ -73,6 +74,12 @@ input=""
|
|||||||
|
|
||||||
echo "Creating temp folder"
|
echo "Creating temp folder"
|
||||||
temp_dir=$(mktemp -d)
|
temp_dir=$(mktemp -d)
|
||||||
|
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -rf "$temp_dir"
|
||||||
|
}
|
||||||
|
|
||||||
cd "$temp_dir"
|
cd "$temp_dir"
|
||||||
|
|
||||||
if [[ -z $sc_download_url && -f $local_path ]]; then
|
if [[ -z $sc_download_url && -f $local_path ]]; then
|
||||||
@@ -103,10 +110,6 @@ rsync -r --remove-source-files * "$eldenring_dir"
|
|||||||
|
|
||||||
echo "Deleting temp download folder"
|
echo "Deleting temp download folder"
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
rm -rf "$temp_dir"
|
|
||||||
}
|
|
||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|||||||
Reference in New Issue
Block a user