divx118

Untitled

Apr 3rd, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. chronos@localhost /usr/local $ sudo insmod /usr/local/modules/x86_64_3.8.11/cifs.ko
  2. insmod: ERROR: could not insert module /usr/local/modules/x86_64_3.8.11/cifs.ko: Invalid parameters
  3.  
  4.  
  5. [del]To automate the process of updating the certificate we need a little script and edit the crontab file.
  6.  
  7. [code]vi acme_update.sh[/code]
  8.  
  9. And copy the below script in acme_update.sh PS don't forget to press the "i"to enable the insert mode in vi before you paste. To save "esc :wq"
  10.  
  11. [code]#!/bin/sh
  12. d=$(date)
  13. logfile="/var/log/acme_update.log"
  14. domain="*.timara.nl"
  15. update=$(/root/acme.sh --cron --home /root/.acme.sh|grep -o force)
  16. if [ "$update" == "" ]; then
  17. # update used certificates
  18. cp "/root/.acme.sh/$domain/$domain.cer" "/usr/syno/etc/ssl/ssl.crt/server.crt"
  19. cp "/root/.acme.sh/$domain/$domain.key" "/usr/syno/etc/ssl/ssl.key/server.key"
  20. # update default certificates
  21. cp "/root/.acme.sh/$domain/$domain.cer" "/usr/syno/etc/packages/VPNPlusServer/certificate/default_ca.crt"
  22. cp "/root/.acme.sh/$domain/$domain.key" "/usr/syno/etc/packages/VPNPlusServer/certificate/default_ca.key"
  23. # restart httpd
  24. synoservicectl --restart httpd-sys
  25. mv "$logfile" "$logfile.old"
  26. echo "$d: lets encrypt $domain certificate updated" >> "$logfile"
  27. else
  28. echo "$d: no need to update certificate $domain yet" >> "$logfile"
  29. fi
  30.  
  31. [/code]
  32. Now make the script executabele:
  33. [code]chmod a+x acme_update.sh[/code]
  34.  
  35. Edit the crontab file and add the last line like the below example so the script will run once a day.
  36. [code]vi /etc/crontab[/code]
  37.  
  38. [code]#minute hour mday month wday who command
  39. 30 4 * * 3 root /sbin/fstrim /volume1
  40. 5 10 * * 0,1,2,3,5 root /usr/syno/bin/synopkg chkupgradepkg
  41. 2 3 * * 5 root /tmp/synoschedtask --run id=2
  42. 7 18 * * 0 root /usr/syno/bin/synomyds --report_info
  43. 0 0 * * * root /root/acme_update.sh
  44. [/code]
  45.  
  46. Resart the crond:
  47. [code]synoservicectl --restart crond[/code]
  48.  
  49. The script will create a logfile "/var/log/acme_update.log" This will be moved when the certificate is updated to "/var/log/acme_update.log.old"
  50. Note: the crontab will probably be replaced by a SRM update didn't test that yet, so it is possible we need to redo this last step after an update.[/del]
Advertisement
Add Comment
Please, Sign In to add comment