Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
config:env [2010/02/23 16:36] – since bash supports ~/.profile and tcsh supports ~/.cshrc, use "as appropriate" instead of "for X" deuce | config:env [2018/02/28 16:48] – [bash/sh] Mention /etc/profile and sudo -E digital man |
---|
===== SBBSNODE ===== | ===== SBBSNODE ===== |
| |
The ''SBBSNODE'' environment variable **should NOT** be set. This variable is set dynamically((to the path of the current node directory)), by Synchronet, for the use of external online programs (e.g. doors). | The ''SBBSNODE'' environment variable **should NOT** be set by the sysop. This variable is set dynamically((to the path of the current node directory)), by Synchronet, for the use of external online programs (e.g. doors). |
| |
| |
(replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) | (replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) |
| |
| === /etc/profile === |
| In Debian and Debian-based Linux distributions (e.g. Ubuntu), you can also set environment variables in your ''/etc/profile'' file, like so: |
| |
| export SBBSCTRL=/sbbs/ctrl |
| |
| === sudo === |
| When using the ''sudo'' command to execute a Synchronet program with elevated (e.g. root) privileges, you may need to pass the ''-E'' option to preserve the environment variables set the parent shell: |
| |
| sudo -E sbbs |
| |
==== csh/tcsh ==== | ==== csh/tcsh ==== |
| |
setenv SBBSCTRL /sbbs/ctrl | setenv SBBSCTRL /sbbs/ctrl |
(replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) | (replace ''/sbbs/ctrl'' with the full path to your ''[[dir:ctrl]]'' directory) |
| |
| |
| ===== Automatic ===== |
| |
| When the Synchronet [[server:Terminal]] Server executes an external program (e.g. door game, OS command shell, timed events, file transfer protocol drivers, etc.), it will set the following environment variables for the child process to utilize: |
| |
| ^ Variable Name ^ Description ^ Example ^ |
| | ''DSZLOG'' | Path to the current protocol driver log file | ''c:\sbbs\node1\protocol.log'' | |
| | ''SBBSNODE'' | Path to the current node directory | ''c:\sbbs\node1\'' | |
| | ''SBBSCTRL'' | Path to the Synchronet [[dir:ctrl]] directory | ''c:\sbbs\ctrl\'' | |
| | ''SBBSDATA'' | Path to the Synchronet [[dir:data]] directory | ''c:\sbbs\data\'' | |
| | ''SBBSEXEC'' | Path to the Synchronet [[dir:exec]] directory | ''c:\sbbs\exec\'' | |
| | ''SBBSNNUM'' | Current node number | ''1'' | |
| | ''PCBNODE'' | Current node number (only for DOS programs) | ''1'' | |
| | ''DAY'' | Current day of the month (01-31 ) | ''01'' | |
| | ''WEEKDAY'' | Current day of the week abbreviation | ''Mon''| |
| | ''MONTHNAME'' | Current month name abbreviation | ''Jan''| |
| | ''MONTH'' | Current month number (01-12) | ''01'' | |
| | ''YEAR'' | Current year | ''2017'' | |
| |
| These variables can be used by shell scripts, batch files and programs, as needed. |
| |
| |