initial commit of file from CVS for smeserver-webshare on Sat Sep 7 21:15:27 AEST 2024
This commit is contained in:
47
root/etc/e-smith/events/actions/webshare-create
Executable file
47
root/etc/e-smith/events/actions/webshare-create
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
my $projectName = $ARGV [0];
|
||||
my $indexer = $ARGV [1];
|
||||
|
||||
#------------------------------------------------------------
|
||||
# Create the webshare project directory
|
||||
#------------------------------------------------------------
|
||||
|
||||
if ( -e "/opt/webshare/$projectName")
|
||||
{
|
||||
print "webshare $projectName already exists\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
system ("/bin/mkdir /opt/webshare/$projectName");
|
||||
|
||||
if ("$indexer" eq "Full")
|
||||
{
|
||||
system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/");
|
||||
system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-full /opt/webshare/$projectName/conf/config.inc.php");
|
||||
}
|
||||
elsif ("$indexer" eq "NoDelete")
|
||||
{
|
||||
system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/");
|
||||
system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-nodelete /opt/webshare/$projectName/conf/config.inc.php");
|
||||
}
|
||||
elsif ("$indexer" eq "UpDown")
|
||||
{
|
||||
system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/");
|
||||
system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-updown /opt/webshare/$projectName/conf/config.inc.php");
|
||||
}
|
||||
elsif ("$indexer" eq "View")
|
||||
{
|
||||
system ("/bin/cp -R /opt/webshare-tools/phpfm/* /opt/webshare/$projectName/");
|
||||
system ("/bin/cp -f /opt/webshare/$projectName/conf/config.inc.php-view /opt/webshare/$projectName/conf/config.inc.php");
|
||||
}
|
||||
|
||||
system ("/usr/bin/find /opt/webshare/$projectName -type f -exec chmod 644 {} ';'");
|
||||
system ("/usr/bin/find /opt/webshare/$projectName -type d -exec chmod 755 {} ';'");
|
||||
system ("/bin/chown -R www:www /opt/webshare/$projectName/files");
|
||||
|
||||
system ("/bin/touch /home/e-smith/db/webshare/htpasswd.$projectName");
|
||||
system ("/sbin/e-smith/signal-event ibay-modify");
|
||||
}
|
||||
|
||||
exit (0);
|
Reference in New Issue
Block a user