mirror of
https://github.com/jostreff/ghost-cli-update.git
synced 2025-04-19 17:29:12 +03:00
Create ghost-cli-update
This commit is contained in:
parent
db9f93e203
commit
3ee20b17b1
1 changed files with 23 additions and 0 deletions
23
ghost-cli-update
Normal file
23
ghost-cli-update
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/local/bin/bash
|
||||||
|
|
||||||
|
ghost="/usr/home/ghost"
|
||||||
|
|
||||||
|
pushd $ghost
|
||||||
|
output=`sudo -u ghost -D $ghost /usr/local/bin/ghost check-update`
|
||||||
|
echo "$output"
|
||||||
|
if [[ "$output" == *"available"* ]]; then
|
||||||
|
echo "Checking the permissions in GHOST-CMS home ..."
|
||||||
|
sudo -u ghost -D $ghost /usr/bin/find ./ ! -path "./versions/*" -type f -exec chmod 664 {} \;
|
||||||
|
sudo -u ghost -D $ghost GHOST_NODE_VERSION_CHECK=false /usr/local/bin/ghost update
|
||||||
|
echo "Restarting GHOST-CMS ..."
|
||||||
|
/usr/sbin/service ghost restart
|
||||||
|
elif [[ "$output" == *"update"* ]]; then
|
||||||
|
echo "Checking the permissions in GHOST-CMS home ..."
|
||||||
|
sudo -u ghost -D $ghost /usr/bin/find ./ ! -path "./versions/*" -type f -exec chmod 664 {} \;
|
||||||
|
sudo -u ghost -D $ghost GHOST_NODE_VERSION_CHECK=false /usr/local/bin/ghost update
|
||||||
|
echo "Restarting GHOST-CMS ..."
|
||||||
|
/usr/sbin/service pm2 restart
|
||||||
|
else
|
||||||
|
echo "No new version of GHOST-CMS detected."
|
||||||
|
fi
|
||||||
|
popd
|
Loading…
Add table
Reference in a new issue