From 6f157eeea16430aaff3c7b081209b95f433f87e6 Mon Sep 17 00:00:00 2001 From: matic_t Date: Thu, 16 Jul 2020 04:21:38 -0700 Subject: [PATCH] update build_and_upload.sh.template with unlink --- build/build_and_upload.sh.template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/build_and_upload.sh.template b/build/build_and_upload.sh.template index 987e470..093b516 100755 --- a/build/build_and_upload.sh.template +++ b/build/build_and_upload.sh.template @@ -4,10 +4,10 @@ ############################################################################# # Alter these variables -#USERNAME= vps_sign_in(probably name@lexonomy.cjvt.si -#VPS_PASSWORD= vps password -#VPS_USERNAME= user name inside vps(probably name from @lexonomy) -#API_KEY= $(cat path/to/api/token/file) +#USERNAME=vps_sign_in(probably name@lexonomy.cjvt.si +#VPS_PASSWORD=vps password +#VPS_USERNAME=user name inside vps(probably name from @lexonomy) +#API_KEY=$(cat path/to/api/token/file) # Exit if no argument is passed on run if [[ -z "$1" ]]; then @@ -24,4 +24,4 @@ tar czf - ./config.json ./bundle.js ./local.js ./main.css ./main.html | ssh $USE # Create a simlink on VPS that will enable specific plugin on https://lexonomy.cjvt.si/ # Routes must be absolute or it doesn't work. -ssh -t $USERNAME -p $VPS_PASSWORD "sudo ln -s /home/$VPS_USERNAME/plugins/$PLUGIN_NAME /home/ozbolt/plugins/$PLUGIN_NAME" +ssh -t $USERNAME -p $VPS_PASSWORD "sudo -s unlink /home/ozbolt/plugins/$PLUGIN_NAME || true && sudo ln -s /home/$VPS_USERNAME/plugins/$PLUGIN_NAME /home/ozbolt/plugins/$PLUGIN_NAME"