Skip to content

Commit

Permalink
only create softlink if there is no such softlink
Browse files Browse the repository at this point in the history
fixed bug mentioned in comment section
  • Loading branch information
MarvAmBass committed Aug 25, 2015
1 parent bfb432c commit 775e02a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions startup-piwik.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,18 @@ then
fi

echo ">> making piwik available beneath: $PIWIK_RELATIVE_URL_ROOT"
mkdir -p "/usr/share/nginx/$PIWIK_RELATIVE_URL_ROOT"
# adding softlink for nginx connection
echo ">> adding softlink from /piwik to $PIWIK_RELATIVE_URL_ROOT"
mkdir -p "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT"
rm -rf "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT"
ln -s /piwik $(echo "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT" | sed 's/\/$//')

if [ ! -h "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT" ]

This comment has been minimized.

Copy link
@wagnerpinheiro

wagnerpinheiro Sep 3, 2015

not working, after stop and start the container, all /piwiki/ folder is deleted.

then
echo ">> creating softlink"
rm -rf "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT"
ln -s /piwik $(echo "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT" | sed 's/\/$//')
else
echo ">> doesn't create softlink - it already exists"
fi

chown -R www-data:www-data "/usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT"
chmod -R 0755 /usr/share/nginx/html$PIWIK_RELATIVE_URL_ROOT\tmp
Expand Down

0 comments on commit 775e02a

Please sign in to comment.