mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-22 23:45:10 +00:00
adjust doc for 0.98 release
This commit is contained in:
parent
5afe05aa44
commit
24e9ec6e75
@ -90,7 +90,7 @@ Written by Drew (@topkecleon), Daniil Gentili (@danogentili), and Kay M (@gnadel
|
|||||||
<p>Contributions by JuanPotato, BigNerd95, TiagoDanin, and iicc1.</p>
|
<p>Contributions by JuanPotato, BigNerd95, TiagoDanin, and iicc1.</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>
|
<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>Prerequisites</h2>
|
<h2>Prerequisites</h2>
|
||||||
<p>Uses <a href="http://github.com/dominictarr/JSON.sh">JSON.sh</a> and the magic of (gnu) sed.</p>
|
<p>Uses <a href="http://github.com/dominictarr/JSON.sh">JSON.sh</a> and the magic of sed.</p>
|
||||||
<p>Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment. More concret on the common commands provided by recent versions of <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>Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment. More concret on the common commands provided by recent versions of <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><em>Note for MacOS and BSD Users:</em> As bashbot heavily uses modern bash and (gnu) grep/sed features, bashbot will not run without installing additional software, see <a href="doc/0_install.md">Install Bashbot</a></p>
|
<p><em>Note for MacOS and BSD Users:</em> As bashbot heavily uses modern bash and (gnu) grep/sed features, bashbot will not run without installing additional software, see <a href="doc/0_install.md">Install Bashbot</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 available 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 available on www.github.com</p>
|
||||||
@ -257,6 +257,6 @@ It features background tasks and interactive chats, and can serve as an interfac
|
|||||||
<p>@Gnadelwartz</p>
|
<p>@Gnadelwartz</p>
|
||||||
<h2>That's it!</h2>
|
<h2>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>$$VERSION$$ v0.98-pre-3-g0f24eb8</h4>
|
<h4>$$VERSION$$ v0.962-88-g5afe05a</h4>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -9,7 +9,7 @@ Released to the public domain wherever applicable.
|
|||||||
Elsewhere, consider it released under the [WTFPLv2](http://www.wtfpl.net/txt/copying/).
|
Elsewhere, consider it released under the [WTFPLv2](http://www.wtfpl.net/txt/copying/).
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of (gnu) sed.
|
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of sed.
|
||||||
|
|
||||||
Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment.
|
Even bashbot is written in bash, it depends on commands typically available in a Unix/Linux Environment.
|
||||||
More concret on the common commands provided by recent versions of [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)
|
More concret on the common commands provided by recent versions of [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)
|
||||||
@ -239,4 +239,4 @@ wget -t 1 -T 10 https://api.telegram.org/bot
|
|||||||
|
|
||||||
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.98-pre-3-g0f24eb8
|
#### $$VERSION$$ v0.962-88-g5afe05a
|
||||||
|
@ -13,8 +13,7 @@ Elsewhere, consider it released under the
|
|||||||
[WTFPLv2](http://www.wtfpl.net/txt/copying/).
|
[WTFPLv2](http://www.wtfpl.net/txt/copying/).
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of (gnu)
|
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh) and the magic of sed.
|
||||||
sed.
|
|
||||||
|
|
||||||
Even bashbot is written in bash, it depends on commands typically available in
|
Even bashbot is written in bash, it depends on commands typically available in
|
||||||
a Unix/Linux Environment.
|
a Unix/Linux Environment.
|
||||||
@ -328,4 +327,4 @@ failed: Connection timed out.
|
|||||||
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.98-pre-3-g0f24eb8
|
#### $$VERSION$$ v0.962-88-g5afe05a
|
||||||
|
@ -39,7 +39,7 @@ As an alternative to download the zip files, you can clone the github repository
|
|||||||
4. Extract all files to your existing bashbot dir
|
4. Extract all files to your existing bashbot dir
|
||||||
5. Run ```sudo ./bashbot.sh init``` to setup your environment after the update
|
5. Run ```sudo ./bashbot.sh init``` to setup your environment after the update
|
||||||
|
|
||||||
If you modified ```commands.sh``` move your changes to ```mycommands.sh```, this avoids overwrrite of you changes on updates.
|
If you modified ```commands.sh``` move your changes to ```mycommands.sh```, this avoids overwriting your commands on update.
|
||||||
|
|
||||||
Now you can restart your bashbot instances.
|
Now you can restart your bashbot instances.
|
||||||
|
|
||||||
@ -48,22 +48,46 @@ Now you can restart your bashbot instances.
|
|||||||
**On MacOS** you must install a more recent version of bash, as the default bash is way to old,
|
**On MacOS** you must install a more recent version of bash, as the default bash is way to old,
|
||||||
see e.g. [Install Bash on Mac](http://macappstore.org/bash/)
|
see e.g. [Install Bash on Mac](http://macappstore.org/bash/)
|
||||||
|
|
||||||
**On BSD and MacOS** I recommend to install gnu coreutils and include them in front of your PATH
|
**On BSD and MacOS** I recommend to install gnu coreutils and include them in your PATH
|
||||||
environment variable before running bashbot, e.g. the gnu versions of sed, grep, find ...
|
environment variable before running bashbot, e.g. the gnu versions of sed, grep, find ...
|
||||||
|
|
||||||
|
On BSDand MacOS you must adjust the shebang line of the scripts ```bashbot.sh``` and ```json.sh``` to point to to the correct bash
|
||||||
|
or use the script: ```examples/bash2env *.sh */*.sh``` to convert them for you.
|
||||||
|
|
||||||
|
Bashbot will stay with /bin/bash shebang, as using a fixed path is more secure than the portable /usr/bin/env variant, see
|
||||||
|
[Security Considerations](../README.md#Security-Considerations)
|
||||||
|
|
||||||
I considered to make bashbot BSD sed compatible, but much of the bashbot "magic" relies on
|
I considered to make bashbot BSD sed compatible, but much of the bashbot "magic" relies on
|
||||||
(gnu) sed features, e.g. alternation ```|```, non printables ```\n\t\<``` or repeat ```?+``` pattern, not supported by BSD sed.
|
(gnu) sed features, e.g. alternation ```|```, non printables ```\n\t\<``` or repeat ```?+``` pattern, not supported by BSD sed.
|
||||||
BSD/MacOS sed compatibility will result in a rewrite of all grep/sed commands with an uncertain outcome,
|
BSD/MacOS sed compatibility will result in a rewrite of all grep/sed commands with an uncertain outcome,
|
||||||
see [BSD/MacOS vs. GNU sed](https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification)
|
see [BSD/MacOS vs. GNU sed](https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification)
|
||||||
to get an impression how different they are.
|
to get an impression how different they are.
|
||||||
|
|
||||||
In adition you must adjust the shebang line of the scripts ```bashbot.sh``` and ```json.sh``` to point to to the correct bash
|
If you are a sed guru and can convert the following examples to work correct with gnu and BSD sed, contact me.
|
||||||
or use the example script: ```examples/bash2env *.sh */*.sh```
|
|
||||||
|
|
||||||
Bashbot will stay with /bin/bash shebang, as using a fixed path is more secure than the portable /usr/bin/env variant, see
|
```bash
|
||||||
[Security Considerations](../README.md#Security-Considerations)
|
# easy start
|
||||||
|
sed -n -e '0,/\['"$1"'\]/ s/\['"$1"'\][ \t]\([0-9.,]*\).*/\1/p'
|
||||||
|
OUT="$(sed -e ':a;N;$!ba;s/\r\n/ mynewlinestartshere /g' <<<"$1"| iconv -f utf-8 -t utf-8 -c)"
|
||||||
|
|
||||||
### Notes on Updates
|
# more complex
|
||||||
|
address="$(sed <<< "${2}" '/myaddressstartshere /!d;s/.*myaddressstartshere //;s/ *my[nkfltab][a-z]\{2,13\}startshere.*//;s/ *mykeyboardendshere.*//')"
|
||||||
|
|
||||||
|
# for experts?
|
||||||
|
source <( printf "$1"'=( %s )' "$(sed -E -n -e ':x /"text"\]/ { N; s/([^"])\n/\1\\n/g ; tx }' -e '/\["[-0-9a-zA-Z_,."]+"\]\+*\t/ s/\t/=/gp' -e 's/=(true|false)/="\1"/')" )
|
||||||
|
```
|
||||||
|
|
||||||
|
### Notes per Version
|
||||||
|
|
||||||
|
#### Change in storing config values
|
||||||
|
|
||||||
|
Up to version 0.94 bashbot stores config values as values in ```token```, ```botadmin``` and ```count```. Since version 0.96 bashbot
|
||||||
|
uses jsonDB key/value store. Config is stored in ```botconfig.jssh```, counting of users is done in ```count.jssh```.
|
||||||
|
The acl file ```botacl``` stay as is. On first run of bashbot.sh after an update bashbot converts bashbot converts
|
||||||
|
the files to the new config format. Afterwards the files ```token```, ```botadmin``` and ```count``` can be deleted.
|
||||||
|
|
||||||
|
You may notice the new file ```blocked.jssh```, every telegram user and chat id stored ihere will be blocked from
|
||||||
|
using your bot.
|
||||||
|
|
||||||
#### removal of TMUX
|
#### removal of TMUX
|
||||||
From version 0.80 on TMUX is no longer needed and the bachsbot command 'attach' is deleted. Old function 'inproc'
|
From version 0.80 on TMUX is no longer needed and the bachsbot command 'attach' is deleted. Old function 'inproc'
|
||||||
@ -107,5 +131,5 @@ The old format is supported for backward compatibility, but may fail for corner
|
|||||||
|
|
||||||
#### [Next Create Bot](1_firstbot.md)
|
#### [Next Create Bot](1_firstbot.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.98-dev-70-g694ee61
|
#### $$VERSION$$ v0.962-88-g5afe05a
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user