{"id":732,"date":"2022-09-12T17:26:10","date_gmt":"2022-09-12T15:26:10","guid":{"rendered":"http:\/\/cln.io\/blog\/?p=732"},"modified":"2023-03-18T15:30:03","modified_gmt":"2023-03-18T13:30:03","slug":"installing-on-boot-script-on-udm","status":"publish","type":"post","link":"https:\/\/cln.io\/blog\/installing-on-boot-script-on-udm\/","title":{"rendered":"Installing on-boot-script on the UDM Pro (  Dream Machine Pro )"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The UDM Pro isn&#8217;t so &#8220;pro&#8221; since there are some essential features missing from the UI interface (eg: SNAT \/ DNAT ) nonetheless we can &#8220;hack&#8221; our way into getting what we want -ish.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On this page<\/p>\n\n\n\n<nav aria-label=\"Table of Contents\" class=\"wp-block-table-of-contents\"><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/cln.io\/blog\/installing-on-boot-script-on-udm\/#ssh-ing-into-the-udm\">SSH&#8217;ing into the UDM<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/cln.io\/blog\/installing-on-boot-script-on-udm\/#installing-on-boot-script-on-the-udm-pro\">Installing on-boot-script on the UDM-Pro<\/a><\/li><\/ol><\/nav>\n\n\n\n<p class=\"wp-block-paragraph\">There is a fantastic project\/effort on GitHub to allow users to run scripts on the boot of the UDM Pro, we will use this to our advantage!<br><a href=\"https:\/\/github.com\/unifi-utilities\/unifios-utilities\" target=\"_blank\" rel=\"noreferrer noopener\">unifi-utilities\/unifios-utilities<\/a> <br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> We are particularly interested in the <a href=\"https:\/\/github.com\/unifi-utilities\/unifios-utilities\/tree\/main\/on-boot-script\" target=\"_blank\" rel=\"noreferrer noopener\">on-boot-script<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ssh-ing-into-the-udm\">SSH&#8217;ing into the UDM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSH into the UDM with the credentials configured under \u201c<a href=\"https:\/\/unifi.ui.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Console Settings<\/a>\u201d<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"281\" height=\"442\" src=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-42.png\" alt=\"\" class=\"wp-image-721\" srcset=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-42.png 281w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-42-191x300.png 191w\" sizes=\"auto, (max-width: 281px) 100vw, 281px\" \/><figcaption class=\"wp-element-caption\">set an SSH password (username is root)<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"533\" src=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-39.png\" alt=\"\" class=\"wp-image-707\" srcset=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-39.png 839w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-39-300x191.png 300w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/image-39-768x488.png 768w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><figcaption class=\"wp-element-caption\">SSH into the UDM with root and the password you have set<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-on-boot-script-on-the-udm-pro\">Installing on-boot-script on the UDM-Pro<\/h2>\n\n\n\n<p class=\"has-vivid-red-color has-text-color wp-block-paragraph\">NOTE: 04\/2023: the location has changed from \/mnt\/data to \/data, so screenshots are out of date<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">check out the contents of <a href=\"https:\/\/github.com\/unifi-utilities\/unifios-utilities\/blob\/main\/on-boot-script\/remote_install.sh\" target=\"_blank\" rel=\"noreferrer noopener\">remote_install.sh<\/a> and if it is to your liking, lets do the thing everyone tells us not to do, pipe it directly into the shell &#x1f648;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -fsL \"https:\/\/raw.githubusercontent.com\/unifi-utilities\/unifios-utilities\/HEAD\/on-boot-script\/remote_install.sh\" | \/bin\/sh<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"670\" src=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/AnyDesk_tLpYmV2a1n-1024x670.png\" alt=\"\" class=\"wp-image-682\" srcset=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/AnyDesk_tLpYmV2a1n-1024x670.png 1024w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/AnyDesk_tLpYmV2a1n-300x196.png 300w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/AnyDesk_tLpYmV2a1n-768x502.png 768w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/AnyDesk_tLpYmV2a1n.png 1223w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">installation script progress<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Once done, upon boot, it will now execute scripts in \/data\/on_boot.d\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Things you can now do:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run cron jobs (<a href=\"https:\/\/cln.io\/blog\/adding-cronjobs-to-udm\/\" target=\"_blank\" rel=\"noreferrer noopener\">guide here<\/a>)<\/li>\n\n\n\n<li>Run Tailscale (<a href=\"https:\/\/cln.io\/blog\/installing-tailscale-udm-pro\/\" target=\"_blank\" rel=\"noreferrer noopener\">guide here<\/a>)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"681\" src=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/thomas-jensen-h3vT1Kp0FxA-unsplash-1024x681.jpg\" alt=\"\" class=\"wp-image-741\" srcset=\"https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/thomas-jensen-h3vT1Kp0FxA-unsplash-1024x681.jpg 1024w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/thomas-jensen-h3vT1Kp0FxA-unsplash-300x199.jpg 300w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/thomas-jensen-h3vT1Kp0FxA-unsplash-768x511.jpg 768w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/thomas-jensen-h3vT1Kp0FxA-unsplash-1536x1021.jpg 1536w, https:\/\/cln.io\/blog\/wp-content\/uploads\/2022\/09\/thomas-jensen-h3vT1Kp0FxA-unsplash-2048x1362.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Photo by <a href=\"https:\/\/unsplash.com\/@thomasjsn?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noreferrer noopener\">Thomas Jensen<\/a> on <a href=\"https:\/\/unsplash.com\/s\/photos\/internet?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noreferrer noopener\">Unsplash<\/a><\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The UDM Pro isn&#8217;t so &#8220;pro&#8221; since there are some essential features missing from the UI interface (eg: SNAT \/ DNAT ) nonetheless we can &#8220;hack&#8221; our way into getting what we want -ish. On [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":739,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,37],"tags":[],"class_list":["post-732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-networking"],"_links":{"self":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts\/732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/comments?post=732"}],"version-history":[{"count":13,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts\/732\/revisions"}],"predecessor-version":[{"id":1414,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/posts\/732\/revisions\/1414"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/media\/739"}],"wp:attachment":[{"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/media?parent=732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/categories?post=732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cln.io\/blog\/wp-json\/wp\/v2\/tags?post=732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}