Improve currently active detection
This commit is contained in:
parent
189de128a6
commit
5d02b0d96b
1 changed files with 4 additions and 2 deletions
6
arkdep
6
arkdep
|
@ -185,11 +185,13 @@ remove_deployment () {
|
|||
printf 'No deployment defined\n' && exit 1
|
||||
|
||||
# Ensure deployment is not currently active
|
||||
if grep "$2" /proc/cmdline > /dev/null; then
|
||||
if grep "$(readlink -m $arkdep_dir/deployments/$2)" /proc/cmdline > /dev/null; then
|
||||
printf 'Target is currently active deployment\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# Ensure user only provided a single target
|
||||
[[ ! -z $3 ]] && \
|
||||
printf 'Multiple targets provided, remove only accepts a single target at a time\n' && exit 1
|
||||
|
@ -448,7 +450,7 @@ deploy () {
|
|||
for deployment in ${remove_deployments[@]}; do
|
||||
|
||||
# Ensure deployment is not currently active
|
||||
if grep "$deployment" /proc/cmdline > /dev/null; then
|
||||
if grep "$(readlink -m $arkdep_dir/deployments/$deployment)" /proc/cmdline > /dev/null; then
|
||||
break
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue