forked from dragoonDorise/EmuDeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudSyncHealth.sh
129 lines (108 loc) · 3.64 KB
/
cloudSyncHealth.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
clear
source "$HOME/.config/EmuDeck/backend/functions/all.sh"
NONE='\033[00m'
RED='\033[01;31m'
GREEN='\033[01;32m'
YELLOW='\033[01;33m'
PURPLE='\033[01;35m'
CYAN='\033[01;36m'
WHITE='\033[01;37m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
BLINK='\x1b[5m'
cloud_sync_upload_test(){
local emuName=$1
if [ ! -d $savesPath/$emuName ];then
return 2
fi
echo "test" > "$savesPath/$emuName/.temp"
filePath="$savesPath/$emuName/.temp"
"$cloud_sync_bin" -q copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$filePath" "$cloud_sync_provider":"$cs_user"Emudeck/saves/$emuName/.temp && rm -rf "$savesPath/$emuName/.temp" && return 0 || return 1
}
cloud_sync_dowload_test(){
local emuName=$1
if [ ! -d $savesPath/$emuName ];then
return 2
fi
echo "test" > "$savesPath/$emuName/.temp"
filePath="$savesPath/$emuName/.temp"
"$cloud_sync_bin" -q copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$cloud_sync_provider":"$cs_user"Emudeck/saves/$emuName/.temp "$filePath" && rm -rf "$savesPath/$emuName/.temp" && return 0 || return 1
}
echo -e "${CYAN}CloudSync Status Report${NONE}"
echo ""
miArray=("Cemu" "citra" "dolphin" "duckstation" "MAME" "melonds" "mgba" "pcsx2" "ppsspp" "primehack" "retroarch" "rpcs3" "scummvm" "Vita3K" "yuzu" "ryujinx" )
upload="true"
download="true"
launchers="true"
echo -e "${YELLOW}Checking launchers${NONE}"
for entry in "$toolsPath/launchers/"*.sh
do
if [ -f "$entry" ]; then
if grep -q "cloud_sync_startService" $entry; then
echo -e "$entry: ${GREEN}Success${NONE}"
else
echo -e "$entry: ${RED}Failure${NONE}"
launchers="false"
fi
fi
done
if grep -q "cloud_sync_startService" "$toolsPath/launchers/esde/emulationstationde.sh"; then
echo -e "$toolsPath/launchers/esde/emulationstationde.sh: ${GREEN}Success${NONE}"
else
echo -e "$toolsPath/launchers/esde/emulationstationde.sh: ${RED}Failure${NONE}"
fi
echo -e "${YELLOW}Checking for Windows old .lnk files${NONE}"
find "$savesPath" -type f -name "*.lnk" | while read -r entry
do
rm -rf $entry
echo "found and deleted: $entry"
done
found_files="false"
for entry in "$savesPath"/**/*.lnk
do
if [ -f "$entry" ]; then
rm -rf $entry
echo "found and deleted: $entry"
found_files="true"
fi
done
if [ "$found_files" = "false" ]; then
echo "No files with the '.lnk' extension found."
fi
echo -e ""
echo -e "${YELLOW}Testing uploading${NONE}"
# Recorrer el array y ejecutar la función cloud_sync_upload_test para cada elemento
for elemento in "${miArray[@]}"; do
echo -ne "Testing $elemento upload..."
if cloud_sync_upload_test $elemento;then
echo -e "${GREEN}Success${NONE}"
elif [ $? = 2 ]; then
echo -e "${YELLOW}Save folder not found${NONE}"
else
echo -e "${RED}Failure${NONE}"
upload="false"
fi
done
echo ""
echo -e "${YELLOW}Testing downloading${NONE}"
# Recorrer el array y ejecutar la función cloud_sync_upload_test para cada elemento
for elemento in "${miArray[@]}"; do
echo -ne "Testing $elemento download..."
if cloud_sync_dowload_test $elemento;then
echo -e "${GREEN}Success${NONE}"
elif [ $? = 2 ]; then
echo -e "${YELLOW}Save folder not found${NONE}"
else
echo -e "${RED}Failure${NONE}"
download="false"
fi
done
echo -e ""
echo -e "${CYAN}Recommendations${NONE}"
if [ $download = "true" ] && [ $upload = "true" ] && [ $launchers = "true" ]; then
echo -e "${YELLOW}Everything seems to be in proper order, at least on Linux${NONE}"
else
echo -e "${YELLOW}Open EmuDeck, go to Manage Emulators and reset SteamRomManager Configuration. Then test some games and if it keeps failing open Steam Rom Manager and parse all your games again to get the proper launchers${NONE}"
fi
sleep 100000