Skip to content

Commit

Permalink
update secure.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpark committed Nov 3, 2022
1 parent 7e39c9a commit 26c607e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions secure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ echo
$NORMAL

if [ -f config.php ]; then
$MESSAGE
mv config.php config.php.$$
cp config.php.$$ config.php
rm config.php.$$
chmod 644 config.php
if [ $? -ne 0 ]; then
$MESSAGE
mv config.php config.php.$$
cp config.php.$$ config.php
rm -f config.php.$$
chmod 644 config.php
fi
chmod 711 . data
echo "*** chmod 644 config.php"
$NORMAL
fi

IMG_DIR=`cat config.php |grep '$imgs_dir='|cut -d\' -f2`
IMG_DIR=`cat config.php |grep '^$imgs_dir='|cut -d\' -f2`
[ -n "$IMG_DIR" ] && [ -f imgs_htaccess ] && [ ! -f .$IMG_DIR/.htaccess ] &&
cp imgs_htaccess .$IMG_DIR/.htaccess && rm imgs_htaccess

PDS_DIR=`cat config.php |grep '$upload_dir='|cut -d\' -f2`
PDS_DIR=`cat config.php |grep '^$upload_dir='|cut -d\' -f2`
[ -n "$PDS_DIR" ] && [ -f pds_htaccess ] && [ ! -f $PDS_DIR/.htaccess ] &&
cp pds_htaccess $PDS_DIR/.htaccess && rm pds_htaccess

$SUCCESS
echo ""
echo "Your MoniWiki is now secure and cannot be configured."
echo "If you wish to reconfigure it, execute the following command:"
echo "If you want to config your wiki again, execute the following command:"
echo ""
echo -n " "
$MESSAGE
Expand All @@ -45,7 +48,7 @@ $NORMAL
echo sh monisetup.sh
$SUCCESS
echo ""
echo "and open 'monisetup.php' on a web browser."
echo "and open 'monisetup.php' on your web browser."
echo ""
echo ""
$NORMAL

0 comments on commit 26c607e

Please sign in to comment.