Skip to content

Commit 9e8cd72

Browse files
committed
Großes (verspätetes) Oster-Update
Hinzugefügt: - "FehlerCodes_Dev" Datei, um schnell die Ursache eines Fehlers zu erkennen. - "To-Do" Datei, um geplante Funktionen im Blick zu halten - Mehr Kommentare - Error Funktion, die bei einem Fehler inkraft tritt - Fail Stop bei fehlender Datei Verbessert: - Code minifiziert - Max Bot Zahl auf 13 gesenkt - Automatische Port Wahl hinzugefügt
1 parent 2b7b4bc commit 9e8cd72

3 files changed

Lines changed: 104 additions & 37 deletions

File tree

FehlerCodes_Dev

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#001
2+
Port Datei existiert nicht | User Datei existiert
3+
#002
4+
Port Datei existiert | User Datei existiert nicht
5+
#003
6+
Keine User mehr verfügbar
7+
#004
8+
Keine Ports mehr verfügbar
9+
Ist nur der Fall, wenn es mehr User als Ports gibt

MultiscriptByMobulos.sh

Lines changed: 94 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
############################################
1313
################# CHANGE ###################
14-
ver=3.2.5
15-
dat=08.04.2021
14+
ver=3.2.6
15+
dat=09.04.2021
1616
filescript=MultiscriptByMobulos.sh
1717
link=https://raw.githubusercontent.com/Mobulos/MultiscriptByMobulos/master/MultiscriptByMobulos.sh
1818
############################################
@@ -49,32 +49,74 @@ green=($(tput setaf 2))
4949
yellow=($(tput setaf 3))
5050
reset=($(tput sgr0))
5151

52-
#Farbcoe reseten
52+
53+
54+
function error
55+
{
56+
clear
57+
echo -n "$red"
58+
echo "FEHLER #$code"
59+
echo "$reset"
60+
echo "Bitte erstelle ein$yellow issue$reset auf Github: 'https://github.com/Mobulos/MultiscriptByMobulos/issues' und nenne den Fehlercode #$code"
61+
echo
62+
echo "Wenn du das Script weiterhin nutzen willst musst du follgende befehle eingeben:"
63+
echo "$red"
64+
echo "WARNUNG diese Befehle beenden alle screens und löschen alle Bots!!! Mache gegebenenfalls ein Backup der Bots!!!"
65+
echo -n "$yellow"
66+
echo "'pkill screen || rm -r /home/bot* || rm ports user'"
67+
echo "$reset"
68+
echo "Dannach kannst du das Script wie gewohnt starten"
69+
exit 0
70+
}
71+
72+
73+
#Farbcode beim start reseten
5374
echo "$reset"
5475

5576
#Root Check
5677
FILE="/tmp/out.$$"
5778
GREP="/bin/grep"
5879
if [ "$(id -u)" != "0" ]; then
5980
echo "Das Script muss als root gestartet werden." 1>&2
60-
exit 1
81+
exit 0
6182
fi
83+
6284
#Erster start Check
6385
clear
6486
file="ports"
87+
file2="user"
6588
if [ ! -f "$file" ]
6689
then
67-
jumpto install
90+
#Port existiert nicht
91+
if [ ! -f "$file2" ]
92+
then
93+
#Port existiert nicht | User existiert nicht
94+
jumpto install
95+
else
96+
#Port existiert nicht | User existiert
97+
code="001"
98+
error
99+
fi
100+
else
101+
#Port existiert
102+
if [ ! -f "$file2" ]
103+
then
104+
#Port existiert | User existiert nicht
105+
code="002"
106+
error
107+
else
108+
#Port existiert | User existiert
109+
jumpto menue
110+
fi
68111
fi
69-
jumpto menue
70112

113+
echo "test"
71114

72115

73116
install:
74117
apt-get update ||:
75118
apt-get install -y sudo
76119
apt-get update
77-
clear
78120
for i in bzip2 ca-certificates curl libasound2 libegl1 libglib2.0-0 libnss3 libpci3 libxcursor1 libxkbcommon0 libxslt1.1 libxss1 python screen sudo unzip update-ca-certificates wget x11vnc x11-xkb-utils xvfb
79121
do
80122
apt-get install -y $i
@@ -84,7 +126,7 @@ install:
84126

85127
installall:
86128
clear
87-
read -p "Hast du Ubuntu 18.04? (Y|N) Falls du dir nicht sicher bist probiere es mit nein '(N)' " ubuntu
129+
read -n1 -p "Hast du Ubuntu 18.04? (Y|N) Falls du dir nicht sicher bist probiere es mit nein '(N)' " ubuntu
88130
case $ubuntu in
89131
Y|y|J|j)
90132
add-apt-repository universe
@@ -107,38 +149,38 @@ menue:
107149
failedmenue:
108150
clear
109151
echo "$yellow########################################"
110-
read -t 0.1
152+
read -t0.1
111153
echo "##### SinusBot Script by Mobulos #####"
112-
read -t 0.1
154+
read -t0.1
113155
echo "########################################"
114-
read -t 0.1
156+
read -t0.1
115157
echo
116158
echo "$reset"
117-
read -t 0.1
159+
read -t0.1
118160
echo "Version: $ver"
119-
read -t 0.1
161+
read -t0.1
120162
echo "Update vom: $dat"
121163
tmp=($(tput setaf 2)) && echo "$tmp"
122-
read -t 0.1
164+
read -t0.1
123165
echo " 1. Bot installieren"
124166
tmp=($(tput setaf 3)) && echo -n "$tmp"
125-
read -t 0.1
167+
read -t0.1
126168
echo " 2. Bot löschen"
127169
tmp=($(tput setaf 4)) && echo -n "$tmp"
128-
read -t 0.1
170+
read -t0.1
129171
echo " 3. Scripts installieren"
130172
tmp=($(tput setaf 5)) && echo -n "$tmp"
131-
read -t 0.1
173+
read -t0.1
132174
echo " 4. Exsistierende nutzer anzeigen"
133175
tmp=($(tput setaf 6)) && echo -n "$tmp"
134-
read -t 0.1
176+
read -t0.1
135177
echo " 5. Script Updaten"
136-
read -t 0.1
178+
read -t0.1
137179
tmp=($(tput setaf 1))
138180
echo -n "$tmp"
139181
echo " 6. Exit"
140182
echo "$reset"
141-
read -n 1 -p "Bot Befehle: " befehl
183+
read -n1 -p "Bot Befehle: " befehl
142184
case $befehl in
143185
1)
144186
clear
@@ -165,7 +207,7 @@ failedmenue:
165207
5)
166208
clear
167209
echo "Dies kann einige Sekunden dauern!"
168-
read -t 3 -n 1
210+
read -t3 -n1
169211
clear
170212
rm $filescript
171213
wget $link
@@ -181,27 +223,33 @@ failedmenue:
181223
*)
182224
clear
183225
echo "Eingabe wird nicht Akzeptiert."
184-
read -t 3 -n 1
226+
read -t3 -n1
185227
jumpto $failedmenue
186228
;;
187229
esac
188230

189231

190232
start:
191233
clear
192-
for i in bot1 bot2 bot3 bot4 bot5 bot6 bot7 bot8 bot9 bot10 bot11 bot12 bot13 bot14 bot15 bot16 bot17 bot18 bot19 bot20
234+
for i in bot1 bot2 bot3 bot4 bot5 bot6 bot7 bot8 bot9 bot10 bot11 bot12 bot13 nan
193235
do
194236
if id "$i" &>/dev/null; then
195237
#user exsistiert
196238
continue
239+
echo no
240+
elif [ "$i" == "nan" ]; then
241+
clear
242+
code="003"
243+
error
197244
else
198245
user="$i"
246+
echo else
199247
break
200248
fi
201249
done
202250
name="$user"
203251
clear
204-
read -n 1 -t 3 -p "Der neue User heißt jetzt $name "
252+
read -n1 -t3 -p "Der neue User heißt jetzt $name "
205253
echo
206254
adduser --gecos "" --disabled-password $name
207255
adduser $name sudo
@@ -221,14 +269,23 @@ start:
221269
echo "$reset"
222270
read -p "Bitte erstelle ein Passwort fuer den Sinusbot: $reset" pw
223271
clear
224-
echo -n "$yellow"
225-
echo "Der Erste Port Lautet in der Regel 8087"
226-
echo
227-
echo "Folgende Ports sind bereits belegt:"
228-
echo "$reset"
229-
cat ports
230-
read -n 4 -p "Bitte einen neuen 4stelligen Port eingeben: " port
231-
272+
# Port
273+
for i in 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 9099 nan
274+
do
275+
if id "$i" &>/dev/null; then
276+
#user exsistiert
277+
continue
278+
elif [ "$i" == "nan" ]; then
279+
code="004"
280+
error
281+
else
282+
port="$i"
283+
clear
284+
echo "Fuer den Bot wird der Port $yellow $port $reset genutzt"
285+
read -n1 -t3
286+
break
287+
fi
288+
done
232289
#1ststart.sh schreiben
233290
echo "sudo unzip /home/$name/sinusbot.current.zip" >> /home/$name/1ststart.sh
234291
echo "sudo rm /home/$name/sinusbot.current.zip" >> /home/$name/1ststart.sh
@@ -308,12 +365,12 @@ installscripts:
308365
echo
309366
for i in Auto-Channel-Creator CountOnlineUsers expandingChannel slim-online-sheriff SpamControl Sticky_Channel Support-pp saveCPU nickCrashHelper registerNotificator
310367
do
311-
read -t 0.2
368+
read -t0.2
312369
echo " $i"
313370
done
314371
echo
315372
echo
316-
read -t 0.5
373+
read -t0.5
317374
read -n1 -p "Willst du diese Scripts installieren? (Y|N) " scripts
318375
case $scripts in
319376
Y | y | J | j)
@@ -343,7 +400,7 @@ installscripts:
343400
for i in advertising alonemode bookmark followme norecording rememberChannel welcome
344401
do
345402
echo " $i"
346-
read -t 0.2
403+
read -t0.2
347404
done
348405
echo "echo 'Die Scripts wurden nun installiert!'" >> /home/$name/scriptinstall.sh
349406
echo
@@ -392,11 +449,11 @@ delete:
392449
echo "Mögliche Eigabe: bot1"
393450
echo "Falsche Eingabe bot1:8087"
394451
echo
395-
read -n 4 -p "Welchen Bot möchtest du löschen? " name
452+
read -n4 -p "Welchen Bot möchtest du löschen? " name
396453
killall -u $name
397454
clear
398455
cat /home/$name/port
399-
read -n 4 -p "bitte gebe zur verifizierung die obenstehenden Zahlen ein: " ports
456+
read -n4 -p "bitte gebe zur verifizierung die obenstehenden Zahlen ein: " ports
400457
grep -v "$name:$ports" user > user2
401458
mv user2 user
402459
grep -v "$ports" ports > ports2

To-Do

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reset funktion einbauen

0 commit comments

Comments
 (0)