{"id":395,"date":"2019-09-20T12:53:28","date_gmt":"2019-09-20T17:53:28","guid":{"rendered":"https:\/\/www.scheh.com\/?p=395"},"modified":"2019-09-20T12:56:20","modified_gmt":"2019-09-20T17:56:20","slug":"reboot-unifi-aps-from-controller","status":"publish","type":"post","link":"https:\/\/www.scheh.com\/index.php\/2019\/09\/20\/reboot-unifi-aps-from-controller\/","title":{"rendered":"Reboot Unifi AP&#8217;s from controller"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"395\" class=\"elementor elementor-395\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4afcccd elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4afcccd\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-38ae35f\" data-id=\"38ae35f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f0ce628 elementor-widget elementor-widget-text-editor\" data-id=\"f0ce628\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<pre>\n#!\/bin\/bash\n\n#######################################################################\n# A simple script for remotely rebooting a Ubiquiti UniFi access point\n# https:\/\/github.com\/stevejenkins\/unifi-linux-utils\n# https:\/\/github.com\/stevejenkins\/unifi-linux-utils\/blob\/master\/uap_reboot.sh\n# Version 2.3 (Mar 28, 2018)\n# by Steve Jenkins (http:\/\/www.stevejenkins.com\/)\n#\n# Requires bash and sshpass (https:\/\/sourceforge.net\/projects\/sshpass\/)\n# which should be available via dnf, yum, or apt on your *nix distro.\n#\n# apt install bash -y\n# apt install sshpass -y\n# mkdir \/usr\/bin\/unifi-linux-utils\n# nano \/usr\/local\/bin\/unifi-linux-utils\/uap_reboot.sh\n# chmod +x \/usr\/local\/bin\/unifi-linux-utils\/uap_reboot.sh\n#\n#\n#\n# USAGE\n# Update the user-configurable settings below, then run .\/uap_reboot.sh from\n# the command line. To reboot on a schedule, create a cronjob such as:\n# 45 3 * * * \/usr\/local\/bin\/unifi-linux-utils\/uap_reboot.sh > \/dev\/null 2>&amp;1 #Reboot UniFi APs\n# The above example will reboot the UniFi access point(s) every morning at 3:45 AM.\n#######################################################################\n\n# USER-CONFIGURABLE SETTINGS\nusername=ubnt\npassword=ubnt\nknown_hosts_file=\/dev\/null\nuap_list=( 192.168.0.55 192.168.0.56 192.168.0.57 192.168.0.58 )\n\n# SHOULDN'T NEED TO CHANGE ANYTHING PAST HERE\nfor i in \"${uap_list[@]}\"\ndo\necho \"Rebooting UniFi access point at $i...\"\nif sshpass -p $password ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=$known_hosts_file $username\"@$i\" reboot; then\necho \"Access point at $i rebooted!\" 1>&amp;2\nsleep 2m\nelse\necho \"Could not reboot access point at $i.\" 1>&amp;2\nsleep 2m\nfi\ndone\nexit 0\n<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash ####################################################################### # A simple script for remotely rebooting a Ubiquiti UniFi access point # https:\/\/github.com\/stevejenkins\/unifi-linux-utils # https:\/\/github.com\/stevejenkins\/unifi-linux-utils\/blob\/master\/uap_reboot.sh # Version 2.3 (Mar 28, 2018) # by Steve Jenkins (http:\/\/www.stevejenkins.com\/) # # Requires bash and sshpass (https:\/\/sourceforge.net\/projects\/sshpass\/) # which should be available via dnf, yum, or apt on your *nix distro. # # apt install bash [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-395","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3eyIP-6n","_links":{"self":[{"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/comments?post=395"}],"version-history":[{"count":0,"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/posts\/395\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/media?parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/categories?post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scheh.com\/index.php\/wp-json\/wp\/v2\/tags?post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}