Skip to content

Commit 74ab0c2

Browse files
authored
Merge pull request #161 from topkecleon/develop Version 1.20
Version 1.2
2 parents 74e0aa3 + 239dd76 commit 74ab0c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1391
-760
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/botconf*
77
/botacl*
88
/botown*
9-
ˆ.jssh
9+
*.jssh
1010
*.save
1111
*.log
1212
*.swp

README.html

Lines changed: 173 additions & 42 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,16 @@ you shouldn't use echo to display it. [Use printf whenever possible](https://uni
152152
# very simple
153153
echo "text with variables. PWD=$PWD"
154154
printf '%s\n' "text with variables. PWD=$PWD"
155+
printf 'text with variables. PWD=%s\n' "$PWD"
155156
-> text with variables. PWD=/home/xxx
156157

157158
# more advanced
158159
FLOAT="1.2346777892864" INTEGER="12345.123"
159-
echo "text with variabeles. float=$FLOAT, integer=$INTEGER, PWD=$PWD"
160-
->text with variables. float=1.2346777892864, integer=12345.123, PWD=/home/xxx
160+
echo "float=$FLOAT, integer=$INTEGER, PWD=$PWD"
161+
-> float=1.2346777892864, integer=12345.123, PWD=/home/xxx
161162

162-
printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "" "$INTEGER" "$PWD"
163-
->text with variables. float=1.23, integer=12345, PWD=/home/xxx
163+
printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "$FLOAT" "$INTEGER" "$PWD"
164+
-> float=1.23, integer=12345, PWD=/home/xxx
164165
```
165166

166167
### Do not use #!/usr/bin/env bash
@@ -238,6 +239,9 @@ curl -m 10 https://api.telegram.org/bot
238239

239240
wget -t 1 -T 10 https://api.telegram.org/bot
240241
#Connecting to api.telegram.org (api.telegram.org)|46.38.243.234|:443... failed: Connection timed out.
242+
243+
nc -w 2 api.telegram.org 443 || echo "your IP seems blocked by telegram"
244+
#your IP seems blocked by telegram
241245
```
242246

243247
Since Version 0.96 bashbot offers the option to recover from broken connections (aka blocked). Therefore you can provide a function
@@ -265,4 +269,4 @@ bashbotBlockRecover() {
265269

266270
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
267271

268-
#### $$VERSION$$ v1.1-0-ge835bbc
272+
#### $$VERSION$$ v1.20-0-g2ab00a2

README.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,17 @@ possible](https://unix.stackexchange.com/a/6581)
204204
# very simple
205205
echo "text with variables. PWD=$PWD"
206206
printf '%s\n' "text with variables. PWD=$PWD"
207+
printf 'text with variables. PWD=%s\n' "$PWD"
207208
-> text with variables. PWD=/home/xxx
208209

209210
# more advanced
210211
FLOAT="1.2346777892864" INTEGER="12345.123"
211-
echo "text with variabeles. float=$FLOAT, integer=$INTEGER, PWD=$PWD"
212-
->text with variables. float=1.2346777892864, integer=12345.123, PWD=/home/xxx
212+
echo "float=$FLOAT, integer=$INTEGER, PWD=$PWD"
213+
-> float=1.2346777892864, integer=12345.123, PWD=/home/xxx
213214

214-
printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "" "$INTEGER"
215-
"$PWD"
216-
->text with variables. float=1.23, integer=12345, PWD=/home/xxx
215+
printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "$FLOAT"
216+
"$INTEGER" "$PWD"
217+
-> float=1.23, integer=12345, PWD=/home/xxx
217218
```
218219

219220
### Do not use #!/usr/bin/env bash
@@ -323,6 +324,9 @@ curl -m 10 https://api.telegram.org/bot
323324
wget -t 1 -T 10 https://api.telegram.org/bot
324325
#Connecting to api.telegram.org (api.telegram.org)|46.38.243.234|:443...
325326
failed: Connection timed out.
327+
328+
nc -w 2 api.telegram.org 443 || echo "your IP seems blocked by telegram"
329+
#your IP seems blocked by telegram
326330
```
327331

328332
Since Version 0.96 bashbot offers the option to recover from broken connections
@@ -355,4 +359,4 @@ wait
355359
If you feel that there's something missing or if you found a bug, feel free to
356360
submit a pull request!
357361

358-
#### $$VERSION$$ v1.1-0-ge835bbc
362+
#### $$VERSION$$ v1.20-0-g2ab00a2

addons/antiFlood.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# this addon counts how many files, e.g. stickers, are sent to
55
# a chat and takes actions if threshold is reached
66
#
7-
#### $$VERSION$$ v1.0-0-g99217c4
7+
#### $$VERSION$$ v1.20-0-g2ab00a2
88

99
# used events:
1010
#

addons/example.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Addons can register to bashbot events at startup
55
# by providing their name and a callback per event
66
#
7-
#### $$VERSION$$ v1.2-dev-13-g2a5d47d
7+
#### $$VERSION$$ v1.20-0-g2ab00a2
88
#
99
# If an event occurs each registered event function is called.
1010
#

bashbot.rc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/sh
22
# description: Start or stop telegram-bash-bot
33
#
4-
#### $$VERSION$$ v1.2-dev-13-g2a5d47d
4+
# example service script to run bashbot in background as specified user
5+
#
6+
# tested on: ubuntu, opensuse, debian
7+
#
8+
#### $$VERSION$$ v1.20-0-g2ab00a2
59
# shellcheck disable=SC2009
610
# shellcheck disable=SC2181
711

@@ -23,9 +27,9 @@ runcmd="echo Dry run:" # not activated until you edit lines below
2327
# Configuration Section
2428

2529
# edit the next line to fit the user you want to run bashbot, e.g. nobody:
26-
runas="nobody"
30+
runas="nobody"
2731

28-
# uncomment one of the following lines to fit your system
32+
# uncomment one of the example lines to fit your system
2933
# runcmd="su $runas -s /bin/bash -c " # runasuser with *su*
3034
# runcmd="runuser $runas -s /bin/bash -c " # runasuser with *runuser*
3135

0 commit comments

Comments
 (0)