1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-03 00:07:05 +00:00

add a restart command

This commit is contained in:
downtownallday 2024-09-05 12:39:52 -04:00
parent 54a3bd100c
commit 6d25bc47bf

View File

@ -71,14 +71,14 @@ vlx_exec() {
vlx_exec_usage vlx_exec_usage
return 1 return 1
fi fi
local args=( "$@" ) local args=( "$@" )
local idx=0 local idx=0
while [ $idx -le 3 -a $idx -lt ${#args[*]} ]; do while [ $idx -le 3 -a $idx -lt ${#args[*]} ]; do
[ "${args[$idx]}" = "--" ] && break [ "${args[$idx]}" = "--" ] && break
let idx+=1 let idx+=1
done done
local wd="" local wd=""
if [ "${args[$idx]}" = "--" ]; then if [ "${args[$idx]}" = "--" ]; then
if [ $idx -eq 3 ]; then if [ $idx -eq 3 ]; then
@ -187,7 +187,7 @@ vlx_up() {
return 1 return 1
fi fi
} }
vlx_start() { vlx_start() {
vlx_guess "$@" || return 1 vlx_guess "$@" || return 1
@ -222,6 +222,12 @@ vlx_status() {
fi fi
} }
vlx_restart() {
vlx_guess "$@" || return 1
echo lxc --project "$LX_PROJECT" restart "$LX_INST"
lxc --project "$LX_PROJECT" restart "$LX_INST"
}
usage() { usage() {
echo "Usage:" echo "Usage:"
@ -238,6 +244,7 @@ usage() {
echo " start" echo " start"
echo " stop" echo " stop"
echo " delete|destroy" echo " delete|destroy"
echo " restart"
echo " status" echo " status"
} }
@ -255,4 +262,3 @@ if [ ! "$(type -t $handler)" = "function" ]; then
fi fi
$handler "$@" $handler "$@"