Skip to content

Instantly share code, notes, and snippets.

@NotAwful
Last active October 10, 2018 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NotAwful/729387cc0ce8e2fd82d13ef074d8dcdb to your computer and use it in GitHub Desktop.
Save NotAwful/729387cc0ce8e2fd82d13ef074d8dcdb to your computer and use it in GitHub Desktop.
Move files to known web-facing folder on a digitalocean ghost droplet and changes permissions to make the file accessible
#! /bin/sh
if [ ! -d "/var/www/ghost/content/images/other" ]; then
echo "creating /var/www/ghost/content/images/other"
sudo mkdir /var/www/ghost/content/images/other
sudo chown ghost:ghost /var/www/ghost/content/images/other
sudo chmod 755 /var/www/ghost/content/images/other
fi
echo "moving $1 to /var/www/ghost/content/images/other/$1"
sudo mv $1 /var/www/ghost/content/images/other/$1
sudo chown ghost:ghost /var/www/ghost/content/images/other/$1
sudo chmod 644 /var/www/ghost/content/images/other/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment