{"id":6318,"date":"2023-05-12T17:12:18","date_gmt":"2023-05-12T14:12:18","guid":{"rendered":"http:\/\/surgery.moscow\/smos\/?p=6318"},"modified":"2023-05-12T17:17:58","modified_gmt":"2023-05-12T14:17:58","slug":"%d0%bf%d1%80%d0%be%d0%b2%d0%b5%d1%80%d0%b8%d1%82%d1%8c-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0%d0%b5%d1%82-%d1%81%d0%b0%d0%b9%d1%82-%d0%b8%d0%bb%d0%b8-%d0%bd%d0%b5%d1%82-bash","status":"publish","type":"post","link":"https:\/\/surgery.moscow\/smos\/2023\/05\/12\/%d0%bf%d1%80%d0%be%d0%b2%d0%b5%d1%80%d0%b8%d1%82%d1%8c-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0%d0%b5%d1%82-%d1%81%d0%b0%d0%b9%d1%82-%d0%b8%d0%bb%d0%b8-%d0%bd%d0%b5%d1%82-bash\/","title":{"rendered":"\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0430\u0439\u0442 \u0438\u043b\u0438 \u043d\u0435\u0442 : BASH"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u0439\u0442\u0430 &#8212; \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c e-mail?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0433\u043e\u0442\u043e\u0432\u044b\u0439 BASH \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0430\u0439\u0442 \u0438\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <strong>e-mail <\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u043e <strong>cron <\/strong> \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u0439\u0442\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0441\u0435 \u043f\u0430\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0432\u0430\u0438\u0442\u044c \u0441\u0432\u043e\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b  e-mail<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>#!\/bin\/bash\n\n# Replace 'example.com' with the website you want to check\nwebsite='example.com'\n\n# Send a HEAD request to the website and capture the response code\nresponse=$(curl -s -o \/dev\/null -w \"%{http_code}\" \"$website\")\n\n# Check if the response code indicates that the website is down\nif &#91;&#91; $response -ne 200 ]]; then\n    echo \"Website $website is down (HTTP response code $response)\"\n    # Replace 'admin@example.com' with the email address to notify about the website being down\n    echo \"Sending email notification to admin@example.com\"\n    # Replace 'mail.example.com' with your SMTP server and 'username' and 'password' with your SMTP credentials\n    echo \"Website $website is down (HTTP response code $response)\" | mailx -s \"Website down\" -S smtp=mail.example.com:587 -S smtp-use-starttls -S smtp-auth=login -S smtp-auth-user=username -S smtp-auth-password=password admin@example.com\nfi<\/strong><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u0439\u0442\u0430 &#8212; \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c e-mail? \u0433\u043e\u0442\u043e\u0432\u044b\u0439 BASH \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0430\u0439\u0442 \u0438\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 e-mail \u0437\u0430\u043f\u0443\u0441\u043a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,12,22],"tags":[859,554],"class_list":["post-6318","post","type-post","status-publish","format-standard","hentry","category-computer","category-internet","category-technology","tag-bash","tag-linux"],"_links":{"self":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts\/6318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/comments?post=6318"}],"version-history":[{"count":3,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts\/6318\/revisions"}],"predecessor-version":[{"id":6322,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/posts\/6318\/revisions\/6322"}],"wp:attachment":[{"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/media?parent=6318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/categories?post=6318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/surgery.moscow\/smos\/wp-json\/wp\/v2\/tags?post=6318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}