wordpress/update-app.sh

33 lines
547 B
Bash
Raw Permalink Normal View History

2023-12-07 21:55:15 +00:00
#!/bin/sh
2023-12-07 21:55:15 +00:00
# fail script if one command fails
set -e
# check file permissions
if [ ! -w ~/wp-content/plugins ]
then
echo "Missing file permissions. To fix this, run this command with podman unshare:"
echo " podman unshare ./update-app.sh $1"
exit 0
fi
2023-12-07 21:55:15 +00:00
# we need at least one argument
2023-12-07 21:55:15 +00:00
if [ ! $# -eq 1 ]
2023-12-07 21:55:15 +00:00
then
echo "usage: podman unshare ./update-app.sh \$app"
2023-12-07 21:55:15 +00:00
exit 0
fi
APP=$1
2023-12-07 21:55:15 +00:00
# download app
2023-12-07 21:55:15 +00:00
cd ~/wp-content/plugins
wget https://downloads.wordpress.org/plugin/$APP.zip
2023-12-07 21:55:15 +00:00
# install app
2023-12-07 21:55:15 +00:00
rm -rf $APP
unzip $APP.zip
2023-12-07 21:55:15 +00:00
# clean up
rm $APP.zip