2022-06-01 10:48:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Lutris pre-loader script, for allowing loading multiple pre-load scripts.
|
|
|
|
|
|
|
|
# Enabling debug will enable the script output.
|
2022-06-01 11:43:32 +00:00
|
|
|
FOLDER="./preloader"
|
2022-06-01 10:48:59 +00:00
|
|
|
DEBUG=1
|
|
|
|
|
|
|
|
execute_file () {
|
|
|
|
# Just in case...
|
|
|
|
chmod +x "$1"
|
|
|
|
if [[ $DEBUG -eq 0 ]]; then
|
|
|
|
nohup "$1" >/dev/null 2>&1 &
|
|
|
|
else
|
|
|
|
# No this is not as smart as you think...
|
|
|
|
filename=$(echo "$1" | cut -d "/" -f3)
|
2022-06-01 11:43:32 +00:00
|
|
|
nohup "$1" > ./logs/"$FOLDER"_"$filename".log 2>&1 &
|
2022-06-01 10:48:59 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Checking directory..."
|
2022-06-01 11:43:32 +00:00
|
|
|
mkdir -p "$FOLDER" ./logs/
|
|
|
|
for file in "$FOLDER"/*.*; do
|
2022-06-01 10:48:59 +00:00
|
|
|
[ -e "$file" ] || continue
|
|
|
|
echo "Found $file, loading..."
|
|
|
|
execute_file "$file"
|
|
|
|
done
|
|
|
|
|