/usr/sbin/spip_add_site is in spip 3.0.14-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #!/bin/sh
set -e
SITE=$1
# Script to add a site to spip
if [ "$SITE" = "" ]; then
echo "Usage: spip-add-site site"
exit 1
fi
if [ "`whoami`" != "root" ]; then
echo "This script must be run by root!"
exit 1
fi
if [ -d "/var/lib/spip/sites/$SITE" ]; then
echo "/var/lib/spip/sites/$SITE already exists"
exit 1
fi
if [ -f "/etc/spip/sites/$SITE.php" ]; then
echo "/etc/spip/sites/$SITE.php already exists"
exit 1
fi
echo "Creating site $SITE..."
mkdir -p /var/lib/spip/sites/$SITE/IMG
chown www-data /var/lib/spip/sites/$SITE/IMG
mkdir -p /var/lib/spip/sites/$SITE/tmp
chown www-data /var/lib/spip/sites/$SITE/tmp
mkdir -p /var/lib/spip/sites/$SITE/local
chown www-data /var/lib/spip/sites/$SITE/local
mkdir -p /var/lib/spip/sites/$SITE/config
chown www-data /var/lib/spip/sites/$SITE/config
mkdir -p /var/lib/spip/sites/$SITE/squelettes
chown www-data /var/lib/spip/sites/$SITE/squelettes
mkdir -p /var/lib/spip/sites/$SITE/plugins
chown www-data /var/lib/spip/sites/$SITE/plugins
cat >| /etc/spip/sites/$SITE.php << END
<?php
\$GLOBALS['spip_sites']['$SITE'] = array('$SITE');
?>
END
echo "Directories and files created, you may add hosts for this site in:"
echo " /etc/spip/sites/$SITE.php"
exit 0
|