summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-06-13 08:10:25 +0200
committerRamón M. Gómez <ramongomez@us.es>2018-06-13 08:10:25 +0200
commita3a1ff21dde647ae1e3d8d9fc8552e039bcc3022 (patch)
tree05de750007acd47a9f796b094ca802eaf60d8e7c
parent30628fd3da8e48c19cdfefad8683215215462c47 (diff)
#840: Checking permissions and directories after Git downloads.
-rwxr-xr-xinstaller/opengnsys_update.sh3
-rwxr-xr-xserver/bin/checkperms5
2 files changed, 5 insertions, 3 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index 3635f3d8..be36d643 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -179,6 +179,7 @@ function checkAutoUpdate()
# Actaulizar el script si ha cambiado o no existe el original.
if [ $REMOTE -eq 1 ]; then
curl -s $RAW_URL/installer/$PROGRAMNAME -o $PROGRAMNAME
+ chmod +x $PROGRAMNAME
if ! diff -q $PROGRAMNAME $INSTALL_TARGET/lib/$PROGRAMNAME 2>/dev/null || ! test -f $INSTALL_TARGET/lib/$PROGRAMNAME; then
mv $PROGRAMNAME $INSTALL_TARGET/lib
update=1
@@ -204,7 +205,7 @@ function getDateTime()
# Escribe a fichero y muestra por pantalla
function echoAndLog()
{
- echo $1
+ echo "$1"
DATETIME=`getDateTime`
echo "$DATETIME;$SSH_CLIENT;$1" >> $LOG_FILE
}
diff --git a/server/bin/checkperms b/server/bin/checkperms
index 0d80183c..fbe3be0f 100755
--- a/server/bin/checkperms
+++ b/server/bin/checkperms
@@ -37,6 +37,7 @@ if [ -z "$(getent passwd "$APACHE_USER" 2>/dev/null)" -o -z "$(getent group "$AP
exit 1
fi
+mkdir -p $OPENGNSYS_DIR/{log/clients,images/groups}
chown -R :$OPENGNSYS_USER $OPENGNSYS_DIR/{log/clients,images/groups}
find $OPENGNSYS_DIR/log/clients -type f -exec chmod 664 {} \;
find $OPENGNSYS_DIR/images -maxdepth 1 -exec chown :$OPENGNSYS_USER {} \;
@@ -50,8 +51,8 @@ chmod 600 $OPENGNSYS_DIR/etc/{ogAdmServer,ogAdmAgent}*.cfg
chown root:$APACHE_GROUP $OPENGNSYS_DIR/{www/controlacceso*.php,etc/ogAdmRepo*.cfg}
chmod 640 $OPENGNSYS_DIR/{www/controlacceso*.php,etc/ogAdmRepo*.cfg}
chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www/images/{fotos,iconos}
-chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www/api
-chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www/tmp # ???
+mkdir -p $OPENGNSYS_DIR/www/{api,tmp}
+chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www/{api,tmp}
chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/tftpboot/menu.lst
chown -R :$OPENGNSYS_USER $OPENGNSYS_DIR/tftpboot/ogLive*
find -L $OPENGNSYS_DIR/tftpboot -type d -exec chmod 755 {} \;