<commit_before>auto-shutdown.py
================

This is a simple python script which, when scheduled as a launch job, checks 
if it can ping a list of client ip addresses; if it can't ping any of them for
a an hour it calls shutdown.


Installation
------------

1. Copy the auto-shutdown.py script onto one of your file shares
2. Log into the FreeNas web interface
3. Goto Shell
4. If you have a USB (embedded) install of FreeNas; remount the filesystem rw
4.1. mount -uw /
4.2. mv /mnt/StorageArray/Media/auto-shutdown.py /bin/
4.3. chmod +x /bin/auto-shutdown.py
4.4. sync
4.5. mount -ur /
4.6. reboot
5. Goto System > Cron Jobs > Add Cron Jobs
      Command: /bin/auto-shutdown.py
      Short description: Auto shutdown
      Redirect stdout
      Redirect stderr


Notes
-----

If your using windows clients; you will need to enable ping replies.  There are
many good guides to doing this only, I used this one: 
http://www.howtogeek.com/77132/how-to-enable-ping-echo-replies-in-windows-8/

In short you need to open up the "Windows Firewall and Advanced Settings" MMC
application > Select "Inbound Rules" > "File and Printer Sharing (Echo Request 
- ICMPv4-In)".  Right click and enable rule.

simple!


wake_on_lan.py
--------------

This is the companion script, which is used to send a wake on lan packet to 
FreeNas (when my desktop wakes up) to ensure the shares are avaliable.

You will need to update the mac address in the format: aa:bb:cc:dd:ee:ff, the
easiest way to get the mac address of your FreeNas is to  

1. Log into the FreeNas web interface
2. Goto Shell
3. ifconfig


Keywords
--------
FreeNas, MacOSX, Windows, Ping, Shutdown, Wake on lan
<commit_msg>Instructions for adding an init job<commit_after>auto-shutdown.py
================

This is a simple python script which, when scheduled as a launch job, checks 
if it can ping a list of client ip addresses; if it can't ping any of them for
an hour it calls shutdown.


Requirements
------------

FreeNAS 9.1; for init job support (and HP Microserver WoL support)


Installation
------------

1. Copy the auto-shutdown.py script onto one of your file shares
2. Log into the FreeNas web interface
3. Goto Shell
4. If you have a USB (embedded) install of FreeNas; remount the filesystem rw
4.1. mount -uw /
4.2. mv /mnt/StorageArray/Media/auto-shutdown.py /bin/
4.3. chmod +x /bin/auto-shutdown.py
4.4. sync
4.5. mount -ur /
4.6. reboot
5. Goto System > Add Init/Shutdown Script
	Type: Command
	Command: /bin/auto-shutdown.py
	Type: Post Init


Notes
-----

If your using windows clients; you will need to enable ping replies.  There are
many good guides to doing this only, I used this one: 
http://www.howtogeek.com/77132/how-to-enable-ping-echo-replies-in-windows-8/

In short you need to open up the "Windows Firewall and Advanced Settings" MMC
application > Select "Inbound Rules" > "File and Printer Sharing (Echo Request 
- ICMPv4-In)".  Right click and enable rule.

simple!


wake_on_lan.py
--------------

This is the companion script, which is used to send a wake on lan packet to 
FreeNas (when my desktop wakes up) to ensure the shares are avaliable.

You will need to update the mac address in the format: aa:bb:cc:dd:ee:ff, the
easiest way to get the mac address of your FreeNas is to  

1. Log into the FreeNas web interface
2. Goto Shell
3. ifconfig


Keywords
--------
FreeNas, MacOSX, Windows, Ping, Shutdown, Wake on lan

{'fraction_non_alphanumeric': 0.10266159695817491, 'fraction_numerical': 0.016379058204153262, 'mean_word_length': 3.130434782608696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1577409', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1085, 'n_words': 499}