mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-04-11 08:31:51 +00:00
update doc
This commit is contained in:
parent
eb0cde55df
commit
d5994166c0
@ -18,7 +18,7 @@
|
|||||||
<p>Released to the public domain wherever applicable. Elsewhere, consider it released under the <a href="http://www.wtfpl.net/txt/copying/">WTFPLv2</a>.</p>
|
<p>Released to the public domain wherever applicable. Elsewhere, consider it released under the <a href="http://www.wtfpl.net/txt/copying/">WTFPLv2</a>.</p>
|
||||||
<h2 id="prerequisites">Prerequisites</h2>
|
<h2 id="prerequisites">Prerequisites</h2>
|
||||||
<p>Depends on <a href="http://github.com/tmux/tmux">tmux</a>. Uses <a href="http://github.com/dominictarr/JSON.sh">JSON.sh</a>.</p>
|
<p>Depends on <a href="http://github.com/tmux/tmux">tmux</a>. Uses <a href="http://github.com/dominictarr/JSON.sh">JSON.sh</a>.</p>
|
||||||
<p>Even bashbot is written in bash, it depends on commands typically availible in a Unix/Linux Environment. More concret on the command set provided by <a href="https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands">coreutils</a>, <a href="https://en.wikipedia.org/wiki/BusyBox#Commands">busybox</a> or <a href="https://landley.net/toybox/help.html">toybox</a>.</p>
|
<p>Even bashbot is written in bash, it depends on commands typically availible in a Unix/Linux Environment. More concret on the common commands provided by <a href="https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands">coreutils</a>, <a href="https://en.wikipedia.org/wiki/BusyBox#Commands">busybox</a> or <a href="https://landley.net/toybox/help.html">toybox</a>, see <a href="doc/7_develop.md#common-commands">Developer Notes</a></p>
|
||||||
<p>Bashbot <a href="https://github.com/topkecleon/telegram-bot-bash">Documentation</a> and <a href="https://github.com/topkecleon/telegram-bot-bash/releases">Downloads</a> are availible on www.github.com</p>
|
<p>Bashbot <a href="https://github.com/topkecleon/telegram-bot-bash">Documentation</a> and <a href="https://github.com/topkecleon/telegram-bot-bash/releases">Downloads</a> are availible on www.github.com</p>
|
||||||
<h2 id="documentation">Documentation</h2>
|
<h2 id="documentation">Documentation</h2>
|
||||||
<ul>
|
<ul>
|
||||||
@ -106,6 +106,6 @@
|
|||||||
<p><span class="citation">@Gnadelwartz</span></p>
|
<p><span class="citation">@Gnadelwartz</span></p>
|
||||||
<h2 id="thats-it">That’s it!</h2>
|
<h2 id="thats-it">That’s it!</h2>
|
||||||
<p>If you feel that there’s something missing or if you found a bug, feel free to submit a pull request!</p>
|
<p>If you feel that there’s something missing or if you found a bug, feel free to submit a pull request!</p>
|
||||||
<h4 id="version-v0.80-dev2-14-gaacdc76"><br /><span class="math display"><em>V</em><em>E</em><em>R</em><em>S</em><em>I</em><em>O</em><em>N</em></span><br /> v0.80-dev2-14-gaacdc76</h4>
|
<h4 id="version-v0.80-dev2-15-geb0cde5"><br /><span class="math display"><em>V</em><em>E</em><em>R</em><em>S</em><em>I</em><em>O</em><em>N</em></span><br /> v0.80-dev2-15-geb0cde5</h4>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -13,7 +13,7 @@ Depends on [tmux](http://github.com/tmux/tmux).
|
|||||||
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh).
|
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh).
|
||||||
|
|
||||||
Even bashbot is written in bash, it depends on commands typically availible in a Unix/Linux Environment.
|
Even bashbot is written in bash, it depends on commands typically availible in a Unix/Linux Environment.
|
||||||
More concret on the command set provided by [coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands), [busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) or [toybox](https://landley.net/toybox/help.html).
|
More concret on the common commands provided by [coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands), [busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) or [toybox](https://landley.net/toybox/help.html), see [Developer Notes](doc/7_develop.md#common-commands)
|
||||||
|
|
||||||
|
|
||||||
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Downloads](https://github.com/topkecleon/telegram-bot-bash/releases) are availible on www.github.com
|
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Downloads](https://github.com/topkecleon/telegram-bot-bash/releases) are availible on www.github.com
|
||||||
@ -107,4 +107,4 @@ Well, thats a damn good question ... may be because I'm an Unix/Linux admin from
|
|||||||
|
|
||||||
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
|
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
|
||||||
|
|
||||||
#### $$VERSION$$ v0.80-dev2-14-gaacdc76
|
#### $$VERSION$$ v0.80-dev2-15-geb0cde5
|
||||||
|
@ -16,10 +16,11 @@ Uses [JSON.sh](http://github.com/dominictarr/JSON.sh).
|
|||||||
|
|
||||||
Even bashbot is written in bash, it depends on commands typically availible in
|
Even bashbot is written in bash, it depends on commands typically availible in
|
||||||
a Unix/Linux Environment.
|
a Unix/Linux Environment.
|
||||||
More concret on the command set provided by
|
More concret on the common commands provided by
|
||||||
[coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands),
|
[coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands),
|
||||||
[busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) or
|
[busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) or
|
||||||
[toybox](https://landley.net/toybox/help.html).
|
[toybox](https://landley.net/toybox/help.html), see [Developer
|
||||||
|
Notes](doc/7_develop.md#common-commands)
|
||||||
|
|
||||||
|
|
||||||
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and
|
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and
|
||||||
@ -152,4 +153,4 @@ health status
|
|||||||
If you feel that there's something missing or if you found a bug, feel free to
|
If you feel that there's something missing or if you found a bug, feel free to
|
||||||
submit a pull request!
|
submit a pull request!
|
||||||
|
|
||||||
#### $$VERSION$$ v0.80-dev2-14-gaacdc76
|
#### $$VERSION$$ v0.80-dev2-15-geb0cde5
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.80-dev2-14-gaacdc76
|
#### $$VERSION$$ v0.80-dev2-15-geb0cde5
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
|
@ -51,27 +51,28 @@ A typical bashbot develop loop looks as follow:
|
|||||||
|
|
||||||
**If you setup your dev environment with hooks and use the scripts above, versioning, addding and testing is done automatically.**
|
**If you setup your dev environment with hooks and use the scripts above, versioning, addding and testing is done automatically.**
|
||||||
|
|
||||||
### bash only commands
|
### common commands
|
||||||
We state bashbot is a bash only bot, but this is not true. bashbot is a bash script using bash features PLUS external commands.
|
We state bashbot is a bash only bot, but this is not true. bashbot is a bash script using bash features PLUS external commands.
|
||||||
Usually bash is used in a unix/linux environment where many (GNU) commands are availible, but if commands are missing, bashbot may not work.
|
Usually bash is used in a unix/linux environment where many (GNU) commands are availible, but if commands are missing, bashbot may not work.
|
||||||
|
|
||||||
To avoid this and make bashbot working on as many platforms as possible - from embedded linux to mainframe - I recommed to restrict
|
To avoid this and make bashbot working on as many platforms as possible - from embedded linux to mainframe - I recommed to restrict
|
||||||
ourself to the commands provided by bash and busybox/toybox.
|
ourself to the common commands provided by bash and coreutils/busybox/toybox.
|
||||||
See [Bash Builtins](https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html) and
|
See [Bash Builtins](https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html),
|
||||||
[Busybox Builtins](https://busybox.net/downloads/BusyBox.html)
|
[coreutils](https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands),
|
||||||
|
[busybox](https://en.wikipedia.org/wiki/BusyBox#Commands) and [toybox](https://landley.net/toybox/help.html)
|
||||||
|
|
||||||
mumimum availible commands in bash and busybox. Do you find curl on the list?
|
Availible commands in bash, coreutils, busybox and toybox. Do you find curl on the list?
|
||||||
```bash
|
```bash
|
||||||
.*, [*, [[*, basename, break, builtin*, bzcat, caller*, cat, cd*, chattr,
|
.*, [*, [[*, basename, break, builtin*, bzcat, caller*, cat, cd*, chattr,
|
||||||
chgrp, chmod, chown, clear, command*, continue *, cp, cut, date, declare*,
|
chgrp, chmod, chown, clear, command*, continue *, cp, cut, date, declare*,
|
||||||
dc, dd, df, diff, dirname, du, echo*, ed, eval*, exec*, exit *, expr*, find,
|
dc, dd, df, diff, dirname, du, echo*, eval*, exec*, exit *, expr*, find,
|
||||||
fuser, getopt*, grep, hash*, head, hexdump, id, kill, killall, last, length,
|
fuser, getopt*, grep, hash*, head, hexdump, id, kill, killall, last, length,
|
||||||
less, let*, ln, local*, logname, ls, lsattr, lsmod, man, mapfile*, md5sum, mkdir,
|
less, let*, ln, local*, logname, ls, lsattr, lsmod, man, mapfile*, md5sum, mkdir,
|
||||||
mkfifo, mknod, more, mv, nice, nohup, passwd, patch, printf*, ps, pwd*, read*,
|
mkfifo, mknod, more, mv, nice, nohup, passwd, patch, printf*, ps, pwd*, read*,
|
||||||
readarray*, readonly* return*, rm, rmdir, sed, seq, sha1sum, sha256sum, sha512sum,
|
readarray*, readonly* return*, rm, rmdir, sed, seq, sha1sum, shift*, sleep,
|
||||||
shift*, sleep, source*, sort, split, stat, strings, su, sync, tail, tar, tee, test,
|
source*, sort, split, stat, strings, su, sync, tail, tar, tee, test,
|
||||||
time, times*, timeout, touch, tr, trap*, true, umask*, unix2dos, usleep, uudecode,
|
time, times*, timeout, touch, tr, trap*, true, umask*, usleep, uudecode,
|
||||||
uuencode, vi, wc, wget, which, who, whoami, xargs, yes
|
uuencode, wc, wget, which, who, whoami, xargs, yes
|
||||||
```
|
```
|
||||||
commands marked with \* are bash builtins, all others are external programms. Calling an external programm is more expensive then using bulitins
|
commands marked with \* are bash builtins, all others are external programms. Calling an external programm is more expensive then using bulitins
|
||||||
or using an internal replacement. Here are some examples of internal replacement for external commands:
|
or using an internal replacement. Here are some examples of internal replacement for external commands:
|
||||||
@ -187,5 +188,5 @@ fi
|
|||||||
#### [Prev Function Reference](6_reference.md)
|
#### [Prev Function Reference](6_reference.md)
|
||||||
#### [Next Bashbot Environment](8_custom.md)
|
#### [Next Bashbot Environment](8_custom.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.80-dev2-11-gb55c171
|
#### $$VERSION$$ v0.80-dev2-15-geb0cde5
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#### $$VERSION$$ v0.80-dev2-1-g0b36bc5
|
#### $$VERSION$$ v0.80-dev2-15-geb0cde5
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||||
@ -27,6 +27,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# output current time every $1 seconds
|
# output current time every $1 seconds
|
||||||
|
date "+* It's %k:%M:%S o' clock ..."
|
||||||
while sleep $SLEEP
|
while sleep $SLEEP
|
||||||
do
|
do
|
||||||
date "+* It's %k:%M:%S o' clock ..."
|
date "+* It's %k:%M:%S o' clock ..."
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# files: mycommands.sh.dist
|
# files: mycommands.sh.dist
|
||||||
# copy to mycommands.sh and add all your commands and functions here ...
|
# copy to mycommands.sh and add all your commands and functions here ...
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.80-dev2-11-gb55c171
|
#### $$VERSION$$ v0.80-dev2-15-geb0cde5
|
||||||
#
|
#
|
||||||
|
|
||||||
# uncomment the following lines to overwrite info and help messages
|
# uncomment the following lines to overwrite info and help messages
|
||||||
@ -31,7 +31,7 @@ else
|
|||||||
'/question'*) # start interactive questions
|
'/question'*) # start interactive questions
|
||||||
checkproc
|
checkproc
|
||||||
if [ "$res" -gt 0 ] ; then
|
if [ "$res" -gt 0 ] ; then
|
||||||
startproc "example/question"
|
startproc "examples/question,sh"
|
||||||
else
|
else
|
||||||
send_normal_message "${CHAT[ID]}" "$MESSAGE already running ..."
|
send_normal_message "${CHAT[ID]}" "$MESSAGE already running ..."
|
||||||
fi
|
fi
|
||||||
@ -40,7 +40,7 @@ else
|
|||||||
'/run_notify'*) # start notify background job
|
'/run_notify'*) # start notify background job
|
||||||
myback="notify"; checkback "$myback"
|
myback="notify"; checkback "$myback"
|
||||||
if [ "$res" -gt 0 ] ; then
|
if [ "$res" -gt 0 ] ; then
|
||||||
background "example/notify 60" "$myback" # notify every 60 seconds
|
background "examples/notify.sh 60" "$myback" # notify every 60 seconds
|
||||||
else
|
else
|
||||||
send_normal_message "${CHAT[ID]}" "Background command $myback already running ..."
|
send_normal_message "${CHAT[ID]}" "Background command $myback already running ..."
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user