Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspberrypi-nas

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
raspberrypi-nas [2016/01/21 11:06] – [SSMTP] tomraspberrypi-nas [2025/05/03 09:10] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 352: Zeile 352:
   sudo pacman -S ssmtp   sudo pacman -S ssmtp
  === ssmtp konfigurieren ===  === ssmtp konfigurieren ===
-sudo nano /etc/ssmtp/ssmtp.conf  +  sudo nano /etc/ssmtp/ssmtp.conf 
-+ 
-# /etc/ssmtp.conf -- a config file for sSMTP sendmail. +  
-+  # /etc/ssmtp.conf -- a config file for sSMTP sendmail. 
-# The person who gets all mail for userids < 1000 +  
-# Make this empty to disable rewriting. +  # The person who gets all mail for userids < 1000 
-root=DEIN-ABSENDER-NAME@DOMAIN.TLD +  # Make this empty to disable rewriting. 
-# The place where the mail goes. The actual machine name is required +  root=DEIN-ABSENDER-NAME@DOMAIN.TLD 
-# no MX records are consulted. Commonly mailhosts are named mail.domain.com +  # The place where the mail goes. The actual machine name is required 
-# The example will fit if you are in domain.com and you mailhub is so named. +  # no MX records are consulted. Commonly mailhosts are named mail.domain.com 
-mailhub=SMTP-SERVER:465 +  # The example will fit if you are in domain.com and you mailhub is so named. 
-# Where will the mail seem to come from? +  mailhub=SMTP-SERVER:465 
-rewriteDomain=DOMAIN.TLD +  # Where will the mail seem to come from? 
-# The full hostname +  rewriteDomain=DOMAIN.TLD 
-hostname=(none) +  # The full hostname 
-AuthUser=BENUTZERNAME-VON-MAILADRESSE +  hostname=(none) 
-AuthPass=PASSWORT-VON-MAILADRESSE +  AuthUser=BENUTZERNAME-VON-MAILADRESSE 
-FromLineOverride=YES +  AuthPass=PASSWORT-VON-MAILADRESSE 
-UseTLS=YES+  FromLineOverride=YES 
 +  UseTLS=YES 
 +   
 +==== Crontab mit Skript ==== 
 +Mit der öffentlichen IP und dem ssmtp können wir jetzt unsere Benachrichtigung einrichten. 
 + 
 +Als erstes erstellen wir ein Skript "ExtIP.sh"
 +  #/bin/bash 
 +  sleep 2m 
 +  curl -s http://canhazip.com | mail -s "externeIP" dein@mailadress.tld 
 +   
 +Jetzt konfigurieren wir einen Cronjob 
 +  crontab -e 
 +   
 +Der Raspi soll uns drei mal am Tag (7:00, 12:00, 20:00) die IP mitteilen. Dazu schreiben wir in den Crontab folgendes: 
 +  0 7,12,20 * * * curl -s http://canhazip.com | mail -s "externeIP" dein@mailadress.tld 
 +Wir speichern **CTRL+O** und schliessen **CTRL+X** nano. 
 + 
 +Wollen wir das Skript auch beim booten ausführen, müssen wir einen Cronjob als root erstellen 
 +  su 
 +  crontab -e 
 + 
 +Hier nehmen wir jetzt das Skript mit dem //sleep 2m// und tragen es in den cronjob ein. Hier wird auch die USB-Platte beim booten eingebunden. 
 +  @reboot /home/pitom/ExtIP.sh 
 +  @reboot root mount -a 
 +   
 +Wenn wir jetzt unseren Raspi rebooten, können wir testen ob das Skript funktioniert.
raspberrypi-nas.1453370764.txt.gz · Zuletzt geändert: 2025/05/03 09:10 (Externe Bearbeitung)