Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Added check to make sure script is not already running
Browse files Browse the repository at this point in the history
  • Loading branch information
masonr committed May 4, 2017
1 parent 23fdebb commit 0225f1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plexidrive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
## server. ##
######################################################

# Before starting, check if script is already running
precheck=`ps aux | grep plexidrive.sh | wc -l`
if [ "$precheck" -gt 1 ] ; then
echo "This script is already running, exiting to avoid duplicate uploads."
exit 1
fi

# Directory where this file exists
plexidrive_dir=`dirname $(realpath -s $0)`
cd "$plexidrive_dir"
Expand Down

0 comments on commit 0225f1d

Please sign in to comment.