s9y_conf

~

A script to aid in the setup of Serendipity Blog (S9Y)

Contents

1... Introduction.
2... Perl version.
3... Bash version.
4... Downloads.

Introduction

The script S9Y_conf is intended to aid in the setup of Serendipity Blog (S9Y), especially in a shared install environment, and can be used to create an Apache style config file along with a Bash install script.

I started on the task of writing this script to satisfy my own needs to create a shared installation setup of S9Y over several sites, and have used it succesfully on SuSE Linux 9.3 and SuSE Linux 10.0. Writing it took a little time, but as a result I know a lot more about Bash scripting and how to do things in Perl.

The script was originally written as a Bash script on a SUSE Linux 9.3 machine, which successfully provided a way to incorporate the setup of Serendipity automatically into other scripts performing server setup/maintenance tasks.

A second script has since been written in Perl, which presents an interactive interface allowing the sysadmin to create the entries for each user before creating the final output files.


Top of page

PERL

The default configuration of this script allows any user to run it, using safe defaults for output file paths/names.

Users are presented with an interactive menu system through which they can set configuration parameters for paths and file names, and also maintain the data used by the program to create the final output files.

Sysadmins will be able to enable checks within the code to prevent access from standard system users, or to allow sudo access to create final file output.

This script is broken down into several files, distributed in a directory hierarchy, making it easier for others to modify towards their specific needs.

./ -- + Main script directory
|
+ -- include/ -- + Routines that do not fall into the categories below
| |
| |
| |
| + -- data/ -- + Data handling routines
| | Including safe default settings and
| | possibilities for the addition of
| | version checking/upgrading in the
| | future.
| |
| + -- menus/ -- + Menu routines
| |
| + -- output/ -- + Routines that create the output
| configuration files
|
+ -- lang/ -- + Language definitions

Top of page

BASH

The default configuration allows ONLY the root user to successfully run the script, but system administrators may relax this requirement. In this case it is possible to force final file creation via sudo, to retain some control over runaway users!

This script outputs two files, the paths/names of which can be configured:

$APACHECONFIGFILE example Configuration file suitable for inclusion in an Apache setup.
$S9YINSTALLSCRIPT example BASH script to copy files to web directories

This script returns exit codes enabling error checks where the script is called as part of an overall server setup script. (example)

Error Code Description
0 Execution completed successfully
1 User running script NOT root
2 User aborted
3 Unable to create $APACHECONFIGFILE
4 Unable to create $APACHECONFIGFILE AND unable to remove temporary file $TEMPFILE1
5 Unable to create $APACHECONFIGFILE AND unable to remove temporary file $TEMPFILE2
6 Unable to create $APACHECONFIGFILE AND unable to remove temporary file $TEMPFILE1 AND $TEMPFILE2
7 Unable to create $S9YINSTALLSCRIPT
8 Unable to create $S9YINSTALLSCRIPT and unable to remove $TEMPFILE2
9 Unable to create $TEMPFILE1
10 Unable to chmod $TEMPFILE1
11 Unable to create $TEMPFILE2
12 Unable to chmod $TEMPFILE2
99 ABNORMAL EXIT !! (should never happen [touches wood hurriedly])

Top of page

Downloads

Perl

s9y_conf-perl-0.7.tar.gz Gzipped tar archive

Bash

s9y_conf.sh Uncompressed script
s9y_conf-bash-0.6.1.tar.gz Gzipped tar archive

Last modified Thu Apr 13 08:33:15 2006 BST Valid HTML 4.01 Transitional Valid CSS!