run update-app script with podman unshare

This commit is contained in:
0x90.space 2023-12-07 21:55:15 +00:00
parent 31924ab242
commit 77a54841dc

View file

@ -3,25 +3,18 @@
# fail script if one command fails # fail script if one command fails
set -e set -e
# check if unprivileged
if [ $(id -u) -eq 0 ]
then
echo "Please do not run this script as root."
exit 0
fi
# check file permissions # check file permissions
if [ -w ~/wp-content/plugins ] if [ ! -w ~/wp-content/plugins ]
then then
echo "Missing file permissions. To fix this, run this command as root:" echo "Missing file permissions. To fix this, run this command with podman unshare:"
echo " chown $USER /home/$USER/wp-content/plugins -R" echo " podman unshare ./update-app.sh $1"
exit 0 exit 0
fi fi
# we need at least one argument # we need at least one argument
if [ ! $# -eq 1 ] if [ ! $# -eq 1 ]
then then
echo "usage: ./update-app.sh \$app" echo "usage: podman unshare ./update-app.sh \$app"
exit 0 exit 0
fi fi
APP=$1 APP=$1