From: Konrad Rosenbaum Date: Tue, 20 Mar 2012 17:43:21 +0000 (+0100) Subject: inline docu for web installer X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=b33feed7c4207c60319f73f4868df02f6123c2b3;p=web%2Fkonrad%2Fsmoke.git inline docu for web installer --- diff --git a/www/install.sh b/www/install.sh index 3f0b436..a8c512a 100755 --- a/www/install.sh +++ b/www/install.sh @@ -1,11 +1,13 @@ #!/bin/sh -# (c) Konrad Rosenbaum, 2007-2011 +# +# (c) Konrad Rosenbaum, 2007-2012 # protected under the GNU AGPL version 3 or at your option any newer # see COPYING.AGPL - +#get the directory this script comes from BASE=$(cd `dirname $0`; pwd) +#check that we have exactly one argument: a directory if test $# -ne 1 ; then echo Usage: $0 '' echo @@ -14,16 +16,23 @@ if test $# -ne 1 ; then exit 1 fi +#create target directory TARGET=$1 -mkdir -p $TARGET +mkdir -p $TARGET || { + echo Unable to create directory $TARGET, giving up. + exit 1 +} echo "Copying/Linking from $BASE to $TARGET..." +#link routine, argument: file/dir to symlink from base to target dir xln(){ echo "Linking $1..." ln -sfT $BASE/$1 $TARGET/$1 } +#link all active content: scripts, base pictures, htaccess, translations +# ...stuff that is not customized by the user xln inc xln images xln admin.php @@ -32,6 +41,10 @@ xln machine.php xln translations xln .htaccess +#copy routine, arguments: +# $1: target file name +# $2: optional - source file name, if not present identical to $1 +#does nothing if the target exists xcp(){ a=$TARGET/$1 test x$2 == x && b=$BASE/$1 || b=$BASE/$2 @@ -42,6 +55,11 @@ xcp(){ } } +#copy all templates that need to be adjusted by the user xcp styles xcp template xcp config.php config.php.template + + +echo "Done. Please edit the configuration and check that the installation works." +exit 0