"Fossies" - the Fresh Open Source Software Archive

Member "unix/DEBIAN/postinst" (15 Sep 2021, 1031 Bytes) of package /linux/misc/pandorafms_agent_unix-7.0NG.757.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 PANDORA_LOG=/var/log/pandora/pandora_agent.log
    4 PANDORA_BIN=/usr/bin/pandora_agent
    5 PANDORA_EXEC_BIN=/usr/bin/pandora_agent
    6 PANDORA_HOME=/usr/share/pandora_agent
    7 PANDORA_CFG=/etc/pandora
    8 
    9 LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
   10 
   11 echo "Start log of agent."
   12 echo "$LOG_TIMESTAMP Pandora FMS installer has created this file at startup" > $PANDORA_LOG
   13 
   14 echo "Setting secure permissions and ownership for all Pandora FMS Agent files..."
   15 chmod 700 $PANDORA_BIN
   16 chmod 700 $PANDORA_EXEC_BIN
   17 #~ chmod 600 $PANDORA_HOME/pandora_agent.conf
   18 chmod -R 700 $PANDORA_HOME/plugins
   19 chown -R root $PANDORA_HOME
   20 chmod 640 $PANDORA_LOG
   21 chgrp root $PANDORA_LOG
   22 chown -R root:root $PANDORA_BIN
   23 chown -R root:root $PANDORA_EXEC_BIN
   24 
   25 echo "Enabling start-up agent daemon";
   26 if [ -x `command -v systemctl` ]; then
   27   systemctl daemon-reload
   28   systemctl enable pandora_agent_daemon
   29 else
   30   update-rc.d pandora_agent_daemon defaults
   31 fi
   32 
   33 echo "Please, now setup the $PANDORA_HOME/pandora_agent.conf and before start the pandora_agent_daemon service"