File: secure.sh

package info (click to toggle)
gallery 1.5.4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 26,712 kB
  • ctags: 6,567
  • sloc: php: 33,824; sh: 446; xml: 96; makefile: 88; perl: 61
file content (30 lines) | stat: -rwxr-xr-x 623 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# $Id: secure.sh 6294 2004-06-10 15:08:20Z jenst $

set -e

ROOT=/usr/share/gallery
CONFDIR=/etc/gallery

if [ `whoami` != "root" ] ; then
    echo "You must be root to run this script" 2>&1
    exit 1
fi

for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
    if [  -f $file ]; then
        chown root:root $file
        chmod 644  $file
    fi
done

if [ -f $ROOT/setup/resetadmin ]; then
    rm -f $ROOT/setup/resetadmin
fi

echo ""
echo "Your Gallery is now secure and cannot be configured.  If"
echo "you wish to reconfigure it, run configure.sh as root:"
echo ""
echo "    # $ROOT/configure.sh"
echo ""