Upload files to "misc/scripts"
parent
1e90d7a578
commit
a9b6088b2c
|
@ -0,0 +1,26 @@
|
||||||
|
EXEC_SHELL_PATH=$(command -v bash)
|
||||||
|
|
||||||
|
# Define the music folder and log file path
|
||||||
|
MUSIC_FOLDER="/mnt/Data/Audio/"
|
||||||
|
LOG_FILE="/tmp/navidrome_logfile.log"
|
||||||
|
|
||||||
|
# Create the log directory if it doesn't exist
|
||||||
|
mkdir -p "$(dirname "$LOG_FILE")"
|
||||||
|
|
||||||
|
# Check if the music folder exists
|
||||||
|
if [ ! -d "$MUSIC_FOLDER" ]; then
|
||||||
|
echo -e "\e[91mMount the hard drive first!\e[0m"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change directory to the music folder
|
||||||
|
cd "$MUSIC_FOLDER"
|
||||||
|
|
||||||
|
# Check if Navidrome is already running
|
||||||
|
if pgrep -x "navidrome" > /dev/null; then
|
||||||
|
echo "Navidrome is already running. Exiting."
|
||||||
|
else
|
||||||
|
# Run Navidrome command, redirecting output to the log file and detaching it from the terminal
|
||||||
|
setsid nohup navidrome --musicfolder "$MUSIC_FOLDER" > "$LOG_FILE" 2>&1 &
|
||||||
|
echo "Navidrome started and detached from the terminal."
|
||||||
|
fi
|
|
@ -0,0 +1,11 @@
|
||||||
|
EXEC_SHELL_PATH=$(command -v bash)
|
||||||
|
|
||||||
|
|
||||||
|
# Run Anki with nohup, redirecting output to a log file
|
||||||
|
nohup flatpak run net.ankiweb.Anki > anki.log 2>&1 &
|
||||||
|
|
||||||
|
# Disown the process to remove it from the shell's job table
|
||||||
|
disown
|
||||||
|
|
||||||
|
# Close the terminal
|
||||||
|
exit
|
Loading…
Reference in New Issue