aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-11 15:32:30 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-11 15:32:30 -0300
commit960886175aad9d9cb9352a23edd36b4db786cf6b (patch)
treeea3d77fb27af672930f72b4fa827a8ec2691e2d3
parent088f12e8d4b201dae20de47974b8b2c2f1cabbc0 (diff)
downloadkvmx-960886175aad9d9cb9352a23edd36b4db786cf6b.tar.gz
kvmx-960886175aad9d9cb9352a23edd36b4db786cf6b.tar.bz2
Shell: put the process in background only for up, start and restart actions
-rwxr-xr-xkvmx26
1 files changed, 17 insertions, 9 deletions
diff --git a/kvmx b/kvmx
index 9650d01..abe063a 100755
--- a/kvmx
+++ b/kvmx
@@ -1736,20 +1736,28 @@ function kvmx_shell {
echo "Running in restricted shell mode."
echo "Allowed commands are only `echo $restricted_actions | tr ':' ' '`"
else
- # Process command, nohup version, stdout and stderr are redirected to a file
+ if [ "${STDIN[0]}" == "up" ] || [ "${STDIN[0]}" == "start" ] || [ "${STDIN[0]}" == "restart" ]; then
+ # Process command, nohup version, stdout and stderr are redirected to a file
+ #nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
+
+ # Process command, disown version, stdout are preserved
+ $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} &
+ disown -h
+ else
+ $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
+ fi
+ fi
+ else
+ if [ "${STDIN[0]}" == "up" ] || [ "${STDIN[0]}" == "start" ] || [ "${STDIN[0]}" == "restart" ]; then
+ # Process command, nohup version
#nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
- # Process command, disown version, stdout are preserved
+ # Process command, disown version
$APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} &
disown -h
+ else
+ $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
fi
- else
- # Process command, nohup version
- #nohup $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1}
-
- # Process command, disown version
- $APP_BASE/kvmx ${STDIN[0]} $VM ${STDIN[@]:1} &
- disown -h
fi
fi
done