From d6c3ab85497b9233c88d7197b80f84643d824e23 Mon Sep 17 00:00:00 2001 From: missytake Date: Fri, 8 Apr 2022 12:30:01 +0200 Subject: [PATCH] run update-app script with podman unshare --- update-app.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/update-app.sh b/update-app.sh index 98f3e68..6929297 100755 --- a/update-app.sh +++ b/update-app.sh @@ -3,25 +3,18 @@ # fail script if one command fails 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 -if [ -w ~/wp-content/plugins ] +if [ ! -w ~/wp-content/plugins ] then - echo "Missing file permissions. To fix this, run this command as root:" - echo " chown $USER /home/$USER/wp-content/plugins -R" + echo "Missing file permissions. To fix this, run this command with podman unshare:" + echo " podman unshare ./update-app.sh $1" exit 0 fi # we need at least one argument if [ ! $# -eq 1 ] then - echo "usage: ./update-app.sh \$app" + echo "usage: podman unshare ./update-app.sh \$app" exit 0 fi APP=$1