Skip to content

Commit ad25148

Browse files
committedJan 9, 2017
Improve instructions and quit on IRC connection error
1 parent 43e4e03 commit ad25148

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ connect to
88

99
## Installation
1010

11-
Install the following:
11+
Install requirements on Debian/Ubuntu. Please match similar packages
12+
on other distributions.
1213

13-
php-cli php7.0-xml php-curl
14+
sudo apt install php-cli php-xml php-curl
1415

1516
Make configuration file
1617

‎lib/network.php

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
require_once(__DIR__.'/err.php');
4+
35
$network_curlh = curl_init();
46

57
// Close cURL handle on shutdown. Not sure if really needed.
@@ -33,6 +35,7 @@ function irc_raw($msg) {
3335
if ($network_irc === NULL) {
3436
// Connect first
3537
$network_irc = fsockopen($conf->irc_host, $conf->irc_port);
38+
if ($network_irc === FALSE) err("Unable to connect to IRC");
3639
fwrite($network_irc, "PASS {$conf->irc_pass}\nUSER\nNICK\n");
3740
}
3841
fwrite($network_irc, $msg);

0 commit comments

Comments
 (0)