Skip to content
Browse files

Remove trailing whitespace where appropriate.

  • Loading branch information...
1 parent 0de9c15 commit 7de623df8c288129572f603460f93460147d4dd6 @mattcen mattcen committed with Nov 28, 2012
Showing with 24 additions and 24 deletions.
  1. +1 −1 Makefile
  2. +1 −1 README
  3. +2 −2 config.sample
  4. +10 −10 evalbot.pl
  5. +5 −5 evalcmd
  6. +3 −3 generate-initramfs
  7. +1 −1 limitcmd.pl
  8. +1 −1 savestate
View
2 Makefile
@@ -22,7 +22,7 @@ hda: initramfs.cpio.gz build/bzImage
./savestate hda.tmp save
mv hda.tmp hda
-clean:
+clean:
rm -rf build/ initramfs/
rm -f initramfs.cpio.gz hda hda.tmp fifo *~
View
2 README
@@ -1,7 +1,7 @@
Shbot is an IRC bot that runs shell code. It is a fork of evalbot
(http://www.vidarholen.net/contents/evalbot/).
-To build, you'll need
+To build, you'll need
- Typical build tools: A C compiler, make, yacc, lex ...
- Header files of libraries needed to build bash, awk, mksh etc.
View
4 config.sample
@@ -4,10 +4,10 @@ $nick="shbot";
# The IRC server
$server="irc.freenode.net";
-# The owner's nick. Evalbot will flood this nick with private messages.
+# The owner's nick. Evalbot will flood this nick with private messages.
$owner="";
-# The passwords for !raw
+# The passwords for !raw
$password="";
# The password for nickserv (if registered)
View
20 evalbot.pl
@@ -26,7 +26,7 @@
$SIG{'QUIT'} = 'my_sigint_catcher';
$SIG{'ALRM'} = 'my_alarm';
sub my_sigint_catcher {
- exit(1);
+ exit(1);
}
@@ -40,7 +40,7 @@ sub my_sigint_catcher {
my $joined=0;
sub join_channels {
- foreach (@channels) {
+ foreach (@channels) {
$conn->join( "$_" );
}
$joined=1;
@@ -78,26 +78,26 @@ sub message
{
my( $conn, $event ) = @_;
my( $msg ) = $event->args;
-
+
if( $msg =~/^# botsnack$/ ) {
$conn->privmsg($event->to, "Core dumped.");
} elsif( $msg =~/^# botsmack$/ ) {
$conn->privmsg($event->to, "Segmentation fault");
} elsif( $msg =~/^([^#]*)# (.*)/ ) {
open(FOO, "-|", "./evalcmd", "$1", "$2");
- while(<FOO>) {
+ while(<FOO>) {
$conn->privmsg($event->to, $event->nick . ": $_");
}
close(FOO);
}
}
-sub private
+sub private
{
my( $conn, $event ) = @_;
- my( $msg ) = $event->args;
+ my( $msg ) = $event->args;
- if($event->nick =~ /^$nick$/) { return; } #lol
+ if($event->nick =~ /^$nick$/) { return; } #lol
$conn->privmsg( "$owner", "< " . $event->nick . "> $msg" );
@@ -107,13 +107,13 @@ sub private
$conn->sl($1);
} elsif( $msg =~/^([^#]*)# (.*)/ ) {
open(FOO, "-|", "./evalcmd", "$1", "$2");
- while(<FOO>) {
+ while(<FOO>) {
$conn->privmsg($event->nick, "$_");
}
close(FOO);
} else {
open(FOO, "-|", "./evalcmd", "4", "$msg");
- while(<FOO>) {
+ while(<FOO>) {
$conn->privmsg($event->nick, "$_");
}
close(FOO);
@@ -123,7 +123,7 @@ sub private
sub notice
{
my( $conn, $event ) = @_;
- my( $msg ) = $event->args;
+ my( $msg ) = $event->args;
if ( $event->nick eq "NickServ" ) {
if($joined==0) {
if($nickserv) {
View
10 evalcmd
@@ -21,9 +21,9 @@ lines=$(wc -l <<< "$output")
shopt -s extglob
-if [[ $output == *( ) ]]
+if [[ $output == *( ) ]]
then
- if (( result > 0 ))
+ if (( result > 0 ))
then
echo "no output within the time limit"
else
@@ -32,13 +32,13 @@ then
exit 0
fi
-if (( lines <= 3 )); then
- printf '%s\n' "$output";
+if (( lines <= 3 )); then
+ printf '%s\n' "$output";
exit 0
fi
read -r url < <(./paste <<< "$output")
-if [[ -n $url ]]
+if [[ -n $url ]]
then
etc="etc... ( $url )"
else
View
6 generate-initramfs
@@ -284,7 +284,7 @@ cp build/loadables/* initramfs/usr/lib
for cmd in "${!command_paths[@]}"; do
cp "${command_paths[$cmd]}" "initramfs/bin/$cmd" &&
- strip "$initramfs/bin/$cmd" 2>/dev/null
+ strip "$initramfs/bin/$cmd" 2>/dev/null
update_manpage "$cmd"
done
@@ -413,7 +413,7 @@ ln -sf ttyS0 /dev/tty
hostname bunnies
mkdir -p /proc /tmp
chmod 1777 /tmp
-mount -t proc none /proc
+mount -t proc none /proc
stty -echo
PS1='$({ echo ${_x+o}>/proc/sysrq-trigger;set +x; } 2>/dev/null)${_x=}'
@@ -453,7 +453,7 @@ done
# awk symlinks
#awks=( initramfs/bin/gawk?* )
ln -sf gawk4 initramfs/bin/gawk || exit
-
+
for awk in nawk mawk gawk oawk bwk; do
[[ -e initramfs/bin/$awk ]] || continue;
ln -sf "$awk" initramfs/bin/awk
View
2 limitcmd.pl
@@ -21,7 +21,7 @@ ($)
}
alarm 4;
-while (($pid = wait) != -1 && $pid != $child) {}
+while (($pid = wait) != -1 && $pid != $child) {}
exit $?
#exit ($pid == $child_pid ? 0 : 1);
View
2 savestate
@@ -2,7 +2,7 @@
image="$1"
mkfifo fifo # &> /dev/null
-[[ -r fifo && -w fifo && -p fifo ]] || { echo "fifo fail"; exit 1; }
+[[ -r fifo && -w fifo && -p fifo ]] || { echo "fifo fail"; exit 1; }
< fifo kvm -kernel build/bzImage -initrd initramfs.cpio.gz -hda "$image" -net none -m 64 -nographic -no-kvm |
while read -r f

0 comments on commit 7de623d

Please sign in to comment.
Something went wrong with that request. Please try again.