diff --git a/plugins/shells.rb b/plugins/shells.rb index af05e2233d492e67d1373b818dff87f89a8ba5fd..ec6e851221ca0b0746c602113aa648c6c0273f9a 100644 --- a/plugins/shells.rb +++ b/plugins/shells.rb @@ -83,11 +83,25 @@ class Shells when /^git/i info = [ "https://git.insomnia247.nl", "No shell account is required to sign up here." ] - when /^ports?/i - ports( nick, user, host, from, msg, arguments, con ) - return + when /^port/i + info = [ + "Our shells have ports 5000 to 5500 open for incoming connections.", + "The port command can be used from your shell to determime which ports are available to you.", + "Use port -a to see which ports are still available.", + "Use port -s portnumber to see if a specific port you would like to use is still available.", + "For more information, go here: http://wiki.insomnia247.nl/wiki/Shells_ports" + ] + when /^website/i + info = [ + "Our shells allow you to host a small website on your shell.", + "You need to put your websites files in the public_html folder on your shell.", + "You can now view your website at yourname.insomnia247.nl.", + "For more information, go here: http://wiki.insomnia247.nl/wiki/Shells_websites" + ] + when /^znc/i + info = [ "You can find a guide to setting up ZNC for your shell here: http://wiki.insomnia247.nl/wiki/Shells_ZNC" ] else - info = [ "Available options: Main, FAQ, Rules, Shell, Invite, Good, Bad, Learning, suwww, Heartbeat, Git, Ports" ] + info = [ "Available options: Main, FAQ, Rules, Shell, Invite, Good, Bad, Learning, suwww, Heartbeat, Git, Ports, Websites, ZNC" ] end printhelp( from, con, info ) end @@ -97,59 +111,23 @@ class Shells link( nick, user, host, from, msg, arguments, con ) end - # Show information about open ports - def port( nick, user, host, from, msg, arguments, con ) - ports( nick, user, host, from, msg, arguments, con ) + # Aliasses for link subjects + def port( nick, user, host, from, msg, _arguments, con ) + link( nick, user, host, from, msg, 'port', con ) end - def ports( _nick, _user, _host, from, _msg, _arguments, con ) - info = [ - "Our shells have ports 5000 to 5500 open for incoming connections.", - "The port command can be used from your shell to determime which ports are available to you.", - "Use port -a to see which ports are still available.", - "Use port -s portnumber to see if a specific port you would like to use is still available.", - "For more information, go here: http://wiki.insomnia247.nl/wiki/Shells_ports" - ] - printhelp( from, con, info ) + def ports( nick, user, host, from, msg, _arguments, con ) + link( nick, user, host, from, msg, 'port', con ) end - - # Show information about users websites. - def website( nick, user, host, from, msg, arguments, con ) - websites( nick, user, host, from, msg, arguments, con ) + def website( nick, user, host, from, msg, _arguments, con ) + link( nick, user, host, from, msg, 'website', con ) end - def websites( _nick, _user, _host, from, _msg, _arguments, con ) - info = [ - "Our shells allow you to host a small website on your shell.", - "You need to put your websites files in the public_html folder on your shell.", - "You can now view your website at yourname.insomnia247.nl.", - "For more information, go here: http://wiki.insomnia247.nl/wiki/Shells_websites" - ] - printhelp( from, con, info ) - end - - # Show information about backups. - def backup( nick, user, host, from, msg, arguments, con ) - backups( nick, user, host, from, msg, arguments, con ) + def websites( nick, user, host, from, msg, _arguments, con ) + link( nick, user, host, from, msg, 'website', con ) end - def backups( _nick, _user, _host, from, _msg, _arguments, con ) - info = [ - "You can use the backup command on your shell to backup or restore files from or to our off-site backup.", - "Full backups of the home directories are made every Monday, Wednesday and Friday at 5:40am local time.", - "You need to give your full path to the backup application, so if you want to restore a file called 'code.c' in your home directory:", - "backup --restore /home/username/code.c", - "Use 'backup --help' to get more information on usage.", - "For more info, go here: http://wiki.insomnia247.nl/wiki/Shells_ports" - ] - printhelp( from, con, info ) + def znc( nick, user, host, from, msg, _arguments, con ) + link( nick, user, host, from, msg, 'znc', con ) end - # Show information about ZNC. - def znc( _nick, _user, _host, from, _msg, _arguments, con ) - info = [ - "You can find a guide to setting up ZNC for your shell here: http://wiki.insomnia247.nl/wiki/Shells_ZNC" - ] - printhelp( from, con, info ) - end - # Function to send help about this plugin (Can also be called by the help plugin.) def help( nick, _user, _host, _from, _msg, _arguments, con ) help = [ @@ -157,7 +135,6 @@ class Shells " shells link [topic] - Show link to wiki.", " shells ports - Show information about open ports.", " shells websites - Show information about users websites.", - " shells backups - Show information about backups.", " shells znc - Show information about ZNC.", " shells uptime - Show uptime for shell hosts.", " shells users - Show user count for shell hosts.", @@ -202,10 +179,6 @@ class Shells getstat( from, "kernel" ) end - def twofactor( _nick, _user, _host, from, _msg, _arguments, _con ) - getstat( from, "twofactor" ) - end - # Command to check if there are unvoiced users that should have voice def voice( _nick, _user, _host, _from, _msg, _arguments, _con ) @irc.raw("NAMES #{@chan}")