mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 02:20:12 +01:00
contrib: add "reexec" step to "nm-in-container.sh"
Just a shortcut for reset and exec.
This commit is contained in:
parent
897a96da7b
commit
ae7e7bf3d3
1 changed files with 9 additions and 4 deletions
|
|
@ -56,7 +56,7 @@ EXEC_ENV=()
|
|||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
$0: build|run|exec|stop|reset|clean|journal [--no-cleanup] [--stop] [-- EXTRA_ARGS]
|
||||
$0: build|run|exec|stop|reset|reexec|clean|journal [--no-cleanup] [--stop] [-- EXTRA_ARGS]
|
||||
EOF
|
||||
echo
|
||||
awk '/^####*$/{ if(on) exit; on=1} { if (on) { if (on==2) print(substr($0,3)); on=2; } }' "$BASH_SOURCE"
|
||||
|
|
@ -576,6 +576,11 @@ do_exec() {
|
|||
fi
|
||||
}
|
||||
|
||||
do_reexec() {
|
||||
do_reset
|
||||
do_exec "$@"
|
||||
}
|
||||
|
||||
do_journal() {
|
||||
EXEC_ENV+=( "SYSTEMD_COLORS=0" )
|
||||
do_exec "journalctl" --no-pager "$@"
|
||||
|
|
@ -604,7 +609,7 @@ for (( i=1 ; i<="$#" ; )) ; do
|
|||
j)
|
||||
CMD=journal
|
||||
;;
|
||||
build|run|exec|stop|reset|clean|journal)
|
||||
build|run|exec|stop|reset|reexec|clean|journal)
|
||||
CMD=$c
|
||||
;;
|
||||
--)
|
||||
|
|
@ -631,8 +636,8 @@ done
|
|||
|
||||
test "$UID" != 0 || die "cannot run as root"
|
||||
|
||||
if test "$CMD" != exec -a "$CMD" != journal -a "${#EXTRA_ARGS[@]}" != 0 ; then
|
||||
die "Extra arguments are only allowed with exec command"
|
||||
if test "$CMD" != exec -a "$CMD" != journal -a "$CMD" != reexec -a "${#EXTRA_ARGS[@]}" != 0 ; then
|
||||
die "Extra arguments are only allowed with exec|journal|reexec command"
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue