You are here

Mein erstes echtes bash-Skript!

Error message

  • Deprecated function: Function create_function() is deprecated in _geshifilter_prepare() (line 126 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_prepare() (line 131 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; GeSHi has a deprecated constructor in require_once() (line 837 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/all/modules/libraries/libraries.module).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_process() (line 231 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_prepare() (line 126 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_prepare() (line 131 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_process() (line 231 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_prepare() (line 126 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_prepare() (line 131 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: Function create_function() is deprecated in _geshifilter_process() (line 231 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/sites/siarp.de/modules/geshifilter/geshifilter.pages.inc).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /is/htdocs/wp1022769_0UTS5D8WKG/www/siarp.de/includes/menu.inc).

...erstellt ein Repository und liegt unter /root/tilman/create_repository.sh. Nächstes Ziel: Subversion hook script für automatisiertes Update, damit die Webentwicklung so richtig losgehen kann.

#!/bin/sh

# Erstellt ein Repository unterhalb von /home/svn-repos,
# traegt es in die httpd.conf ein und startet Apache neu
#
# Optionen: -n um den Eintrag in die httpd.conf und den Apache-Neustart
#   abzuschalten
# Parameter: Pfad des neuen Repository (unterhalb von /home/svn-repos/)

if [ $# -eq 2 ]
then
  if [ $1 == "-n" ]
  then
    # Slashes am Anfang und Ende der Pfadangabe entfernen
    repos=${2%\/}
    repos=${repos#\/}
    updateconf=false
  else
    echo "usage: create_repository [-n] repository_path"
    exit 1
  fi
else
  if [ $# -eq 1 ]
  then
    # Slashes am Anfang und Ende der Pfadangabe entfernen
    repos=${1%\/}
    repos=${repos#\/}
    updateconf=true
  else
    echo "usage: create_repository [-n] repository_path"
    exit 2
  fi
fi

mkdir /home/svn-repos/$repos
svnadmin create /home/svn-repos/$repos
chown -R svn.svn /home/svn-repos/$repos
chmod -R ug+w /home/svn-repos/$repos
chmod ug+s /home/svn-repos/$repos /home/svn-repos/$repos/*

# in httpd.conf eintragen und Apache neu starten
if [ $updateconf = true ]
then
  echo "
<Location /svn/$repos>
  DAV svn
  SVNPath /home/svn-repos/$repos
  SVNIndexXSLT \"/subversion-xslt/svnindex.xsl\"
  AuthType Basic
  AuthName \"siarp.de repository\"
  AuthUserFile /home/svn-repos/svn-auth-file
  Require user martin tilman
  SSLRequireSSL
</Location>
" >> /usr/local/apache2/conf/httpd.conf

  /usr/local/apache2/bin/apachectl restart
fi

Comments

/usr/local/apache2/bin/apachectl restart

Was macht denn chmod ug+s /home/svn-repos/$repos /home/svn-repos/$repos/* und warum geht das nicht rekursiv?

Also eigentlich habe ich diese drei Zeilen mit den Rechten aus einer c't und benutze sie immer, ohne sie zu hinterfragen...