Skip to content
Snippets Groups Projects
Commit 6ffc5fa0 authored by Recolic's avatar Recolic :house_with_garden:
Browse files

.

parent 8a7f65a3
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ Any of: aria2c / wget / curl ...@@ -24,7 +24,7 @@ Any of: aria2c / wget / curl
1. Download this repo to anywhere. 1. Download this repo to anywhere.
2. Modify `init.settings` and `runtime.settings`. 2. Modify `init.settings` and `runtime.settings`.
3. Add `* * * * * flock -n /tmp/.vmm.lockfile /path/to/your/cron-callback.sh` into your crontab. 3. Add `* * * * * /path/to/your/cron-callback.sh` into your crontab.
## Supported cloudimg ## Supported cloudimg
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# You may change this directory # You may change this directory
workdir=./data workdir=./data
ver=1.0.61 ver=1.0.62
_self_bin_name="$0" _self_bin_name="$0"
function where_is_him () { function where_is_him () {
...@@ -165,6 +165,14 @@ function do_start () { ...@@ -165,6 +165,14 @@ function do_start () {
done < "$_script_path/runtime.settings" done < "$_script_path/runtime.settings"
} }
# Check if current script is already running. Stupid flock is very unreliable.
for pid in $(pidof -x "$0"); do
if [ $pid != $$ ]; then
echo "$0 : Process is already running with PID $pid"
exit 1
fi
done
mkdir -p "$workdir" mkdir -p "$workdir"
cd "$workdir" || exit $? cd "$workdir" || exit $?
mkdir -p base vm tmp mkdir -p base vm tmp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment