You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
937 B
51 lines
937 B
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
synopsis() {
|
|
cat << EOF
|
|
Usage : `basename $0` [-h]
|
|
EOF
|
|
}
|
|
|
|
help() {
|
|
cat << EOF
|
|
|
|
`basename $0` affiche la liste des systèmes en fonctionnement.
|
|
|
|
`synopsis`
|
|
|
|
-h : affiche cette aide.
|
|
|
|
EOF
|
|
}
|
|
|
|
usage() {
|
|
synopsis
|
|
exit 1
|
|
}
|
|
|
|
args() {
|
|
local opt
|
|
while getopts "h" opt; do
|
|
case $opt in
|
|
h) help; exit 0;;
|
|
?) usage;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
# Programme principal
|
|
|
|
VDN_PATH=$(readlink -f $(dirname $0)/..); . $VDN_PATH/bin/functions.sh
|
|
|
|
args "$@"
|
|
|
|
#ps u | grep 'bash.*[/]vdn-start ' | grep -v linux | sed -re 's/^.* ([^[:space:]]+)$/\1/' | sort | uniq
|
|
#ps -u root -eo cmd | grep 'bash.*[/]vdn-start ' | sed -re 's/^.* ([^[:space:]]+)$/\1/' | sort | uniq
|
|
ps -eo user:14,cmd | grep ^$USER | grep 'bash.*[/]vdn-start ' | sed -re 's/^.* ([^[:space:]]+)$/\1/' | sort | uniq
|
|
|
|
#ps auwx | grep 'name[= ].*user[ =]'$USER' ' | grep -v sed | grep -v grep | sed -re 's/^.*[ -]name[= ]([^[:space:]]+).*$/\1/' | sort | uniq
|
|
|
|
|