Skip to content
Snippets Groups Projects
Commit 81cbe617 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

provide wall command documentation

parent 3a9ef6de
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ This command displays the contents of the service's *state* file. This file are
## Options
- **-h**: prints this help;
- **-h**: prints this help
## Usage example
......
title: The 66 Suite: wall
author: Eric Vidal <eric@obarun.org>
[66](index.html)
[Software](https://web.obarun.org/software)
[obarun.org](https://web.obarun.org)
# wall
Send a message to all users connected to a tty.
## Interface
```
wall [ -h ] message
```
This command sends a *message* to all connected users. It uses `UTMP` to find out which users are logged in. If the *message* contains spaces, it must be enclosed in quotes.
## Exit codes
- *0* success
- *100* wrong usage
- *111* system call failed
## Options
- **-h**: prints this help;
## Usage examples
Send a message to all connected users
```
66 wall "The system will be shut down in 5 minutes. Please, save your work and log out."
```
\ No newline at end of file
......@@ -67,6 +67,7 @@ These options are available all commands except the `-t` options. In such cases,
- [boot](66-boot.html): boot the system.
- [scandir](66-scandir.html): manage scandir.
- [signal](66-signal.html): send a signal to services.
- [wall](66-wall.html): send message to connected users.
### Debug command
......
#!/bin/sh
html='66-echo 66-hpr 66-nuke 66-shutdown 66-shutdownd 66-umountall 66 66-boot 66-configure 66-deeper 66-disable 66-enable execl-envfile 66-free 66-frontend 66-halt index 66-instantiated-service 66-module-creation 66-module-usage 66-parse 66-poweroff 66-reboot 66-reconfigure 66-reload 66-remove 66-resolve 66-restart 66-rosetta 66-scandir 66-service-configuration-file 66-signal 66-start 66-state 66-status 66-stop 66-tree 66-upgrade 66-version'
html='66-echo 66-hpr 66-nuke 66-shutdown 66-shutdownd 66-umountall 66 66-boot 66-configure 66-deeper 66-disable 66-enable execl-envfile 66-free 66-frontend 66-halt index 66-instantiated-service 66-module-creation 66-module-usage 66-parse 66-poweroff 66-reboot 66-reconfigure 66-reload 66-remove 66-resolve 66-restart 66-rosetta 66-scandir 66-service-configuration-file 66-signal 66-start 66-state 66-status 66-stop 66-tree 66-upgrade 66-version 66-wall'
version=${1}
......
#!/bin/sh
man1='66 66-configure 66-disable 66-enable 66-free execl-envfile 66-halt 66-parse 66-poweroff 66-reboot 66-reconfigure 66-reload 66-remove 66-resolve 66-restart 66-rosetta 66-scandir 66-signal 66-start 66-state 66-status 66-stop 66-tree 66-upgrade 66-version'
man1='66 66-configure 66-disable 66-enable 66-free execl-envfile 66-halt 66-parse 66-poweroff 66-reboot 66-reconfigure 66-reload 66-remove 66-resolve 66-restart 66-rosetta 66-scandir 66-signal 66-start 66-state 66-status 66-stop 66-tree 66-upgrade 66-version 66-wall'
man8='66-boot 66-hpr 66-shutdown 66-shutdownd 66-umountall'
......
......@@ -388,6 +388,12 @@ int main(int argc, char const *const *argv)
PROG = "wall" ;
if (!argv[1])
log_die(LOG_EXIT_USER, "missing message to send") ;
if (!strcmp(argv[1], "-h")) {
info_help(help_wall, usage_wall) ;
return 0 ;
}
/** message need to be double quoted.
* we don't check that here */
hpr_wall(argv[1]) ;
......
......@@ -220,6 +220,8 @@ extern char const *usage_reboot ;
extern char const *help_reboot ;
extern char const *usage_halt ;
extern char const *help_halt ;
extern char const *usage_wall ;
extern char const *help_wall ;
#define OPTS_MAIN "hv:l:t:T:z"
#define OPTS_MAIN_LEN (sizeof OPTS_MAIN - 1)
......
......@@ -23,7 +23,7 @@ inline void info_help (char const *help,char const *usage)
}
char const *usage_66 = "66 [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -T timeout ] [ -t tree ] start|stop|reload|restart|free|reconfigure|enable|disable|configure|status|resolve|state|remove|signal|tree|parse|scandir|boot|poweroff|reboot|halt|version [<command options> or <subcommand options> ] service...|tree" ;
char const *usage_66 = "66 [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -T timeout ] [ -t tree ] start|stop|reload|restart|free|reconfigure|enable|disable|configure|status|resolve|state|remove|signal|tree|parse|scandir|boot|poweroff|reboot|halt|wall|version [<command options> or <subcommand options> ] service...|tree" ;
char const *help_66 =
"\nprogram to init a system, control and manage services\n"
......@@ -58,6 +58,7 @@ char const *help_66 =
" poweroff: poweroff the system\n"
" reboot: reboot the system\n"
" halt: halt the system\n"
" wall: send message to all users connected"
" version: display 66 version\n"
"\n"
"Use '66 <command> -h' to see command options\n"
......@@ -648,3 +649,12 @@ char const *help_halt =
" -t time: use time as grace time period between SIGTERM and SIGKILL\n"
" -W: do not send a wall message to users\n"
;
char const *usage_wall = "66 wall [ -h ] message" ;
char const *help_wall =
"\nsend message to connected users\n"
"\n"
"options:\n"
" -h: print this help\n"
;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment