+# sets up a link to represent the serverpilot storage location, while
+# still storing the files under /var/www.
+function create_shadow_path()
+{
+ # make sure there is a symbolic link from the shadow path (that mimics the serverpilot
+ # storage set up) to the real storage directory.
+ if [ ! -L "$SHADOWPATH" ]; then
+ # create the path up to but not including the last component.
+ if [ ! -d $(dirname $SHADOWPATH) ]; then
+ mkdir -p $(dirname $SHADOWPATH)
+ if [ $? -ne 0 ]; then
+ echo "The parent of the shadow path could not be created."
+ echo "Path in question is: $(dirname $SHADOWPATH)"
+ exit 1
+ fi
+ fi
+
+ ln -s "$BASEPATH" "$SHADOWPATH"
+#hmmm: should we be okay with it if it's a real dir, and assume people are happy?
+# this wouldn't work too well if we go plunk down the new thing in /var/www,
+# if they are expecting this tool to totally meld with serverpilot.
+ if [ $? -ne 0 ]; then
+ echo "The shadow path for mimicking serverpilot could not be created."
+ echo "Is there a real directory present for this already?"
+ echo "Path in question is: $SHADOWPATH"
+ exit 1
+ fi
+ fi
+}
+