Last active
November 26, 2020 15:54
-
-
Save alyssadev/60479cdeb1f8b89c2a89de36d62e4832 to your computer and use it in GitHub Desktop.
A Packer build file that produces an ubuntu 20.04 droplet with megacmd and rclone set up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"MEGA_EMAIL": "{{env `MEGA_EMAIL`}}", | |
"MEGA_PASSW": "{{env `MEGA_PASSW`}}", | |
"MEGA_ENC_PASSW": "{{env `MEGA_ENC_PASSW`}}" | |
}, | |
"builders": [ | |
{ | |
"type": "digitalocean", | |
"image": "ubuntu-20-04-x64", | |
"region": "sgp1", | |
"size": "s-4vcpu-8gb", | |
"ssh_username": "root" | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"pause_before": 20, | |
"expect_disconnect": true, | |
"inline": [ | |
"#!/bin/bash -x", | |
"sudo apt-get update", | |
"wget https://mega.nz/linux/MEGAsync/xUbuntu_20.04/amd64/megacmd_1.4.0-5.1_amd64.deb -O megacmd.deb", | |
"sudo dpkg -i megacmd.deb || sudo apt-get install -yf", | |
"mega-login {{user `MEGA_EMAIL`}} {{user `MEGA_PASSW`}}", | |
"mega-whoami", | |
"curl https://rclone.org/install.sh | sudo bash", | |
"mkdir /root/mega", | |
"mkdir -p /root/.config/rclone", | |
"echo \"[mega]\ntype = mega\nuser = {{user `MEGA_EMAIL`}}\npass = {{user `MEGA_ENC_PASSW`}}\" | tee /root/.config/rclone | |
/rclone.conf", | |
"sudo reboot" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment