Commit 08977983 authored by Richard Mansfield's avatar Richard Mansfield

Run langpacks scripts as maharabot user

parent 91f6ff9d
#
# Regular cron jobs for the custom-site-mahara-langpacks package
#
22 * * * * root [ -x /usr/lib/mahara-langpacks/langpacks.sh ] && /usr/lib/mahara-langpacks/langpacks.sh >> /var/log/mahara-langpacks.log 2>&1
52 * * * * root [ -x /usr/lib/mahara-langpacks/update-pot.sh ] && /usr/lib/mahara-langpacks/update-pot.sh >> /var/log/mahara-langpacks.log 2>&1
# 22 * * * * maharabot [ -x /usr/lib/mahara-langpacks/langpacks.sh ] && /usr/lib/mahara-langpacks/langpacks.sh >> /var/log/mahara-langpacks/langpacks.log 2>&1
# 52 * * * * maharabot [ -x /usr/lib/mahara-langpacks/update-pot.sh ] && /usr/lib/mahara-langpacks/update-pot.sh >> /var/log/mahara-langpacks/update-pot.log 2>&1
......@@ -19,16 +19,39 @@ set -e
case "$1" in
configure)
adduser --system --quiet maharabot
if [ ! -d /home/maharabot/.ssh ] ; then
mkdir /home/maharabot/.ssh
ssh-keygen -q -t rsa -N '' -f /home/maharabot/.ssh/id_rsa
chown -R maharabot /home/maharabot/.ssh
fi
if [ ! -d /var/www/mahara-langpacks ]; then
mkdir /var/www/mahara-langpacks
fi
if [ `stat -c %U /var/www/mahara-langpacks` != 'maharabot' ]; then
chown -R maharabot /var/www/mahara-langpacks
fi
if [ ! -d /var/lib/mahara-langpacks ]; then
mkdir /var/lib/mahara-langpacks
fi
if [ `stat -c %U /var/lib/mahara-langpacks` != 'maharabot' ]; then
chown -R maharabot /var/lib/mahara-langpacks
fi
if [ ! -d /var/log/apache2/mahara-langpacks ]; then
mkdir /var/log/apache2/mahara-langpacks
fi
if [ ! -d /var/log/mahara-langpacks ]; then
mkdir /var/log/mahara-langpacks
chown maharabot /var/log/mahara-langpacks
fi
echo "DATA=/var/lib/mahara-langpacks" > /etc/mahara-langpacks.conf
echo "SCRIPTS=/usr/lib/mahara-langpacks" >> /etc/mahara-langpacks.conf
echo "DOCROOT=/var/www/mahara-langpacks" >> /etc/mahara-langpacks.conf
......
......@@ -22,6 +22,7 @@ case "$1" in
rm -rf /var/lib/mahara-langpacks
rm -rf /var/www/mahara-langpacks
rm -rf /var/log/apache2/mahara-langpacks
rm -rf /var/log/mahara-langpacks
rm -f /etc/apache2/sites-available/mahara-langpacks.conf
;;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment