Guest User

update_and _email.sh

a guest
Apr 11th, 2021
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # Copyright © 2020 Benoit Boudaud <https://miamondo.org/contact>
  4. # This program is free software: you can redistribute it and/or modify it under
  5. # the terms of the GNU General Public License as published by the Free Software
  6. # Foundation, either version 3 of the License, or any later version. This
  7. # program is distributed in the hope that it will be useful, but WITHOUT ANY
  8. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  9. # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. # You should have received a copy of the GNU General Public License along with
  11. # this program. If not, see <http://www.gnu.org/licenses/>
  12.  
  13. # Name: update_and_email.sh
  14.  
  15. # This script takes two parameters: a mail address and a webmail.
  16. # It updates the system and sends a report to the given mail address.
  17. # Prerequisite: swaks should be installed.
  18.  
  19. # Update
  20. sudo pacman -Syu > /home/$USER/result.log
  21.  
  22. # Password (hidden. For security reasons, the cursor doesn't move)
  23. stty -echo
  24. read -p "Your e-mail password: " passw; echo
  25.  
  26. # report is sent
  27. swaks -t $1 -s $2:587 -tls -au $1 -ap $passw -f \
  28. $1 --h-Subject "System update" --body "Process ended" --attach \
  29. /home/$USER/result.log
  30.  
  31. # Log file is destroyed
  32. rm /home/$USER/result.log
  33.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×