�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /etc/rc4.d/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //etc/rc4.d/K01clamav-freshclam
#!/bin/sh

### BEGIN INIT INFO
# Provides:          clamav-freshclam
# Required-Start:    $remote_fs $syslog
# Should-Start:      clamav-daemon
# Required-Stop:     $remote_fs $syslog
# Should-Stop:       
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: ClamAV virus database updater
# Description:       Clam AntiVirus virus database updater
### END INIT INFO

# The exit status codes should comply with LSB.
# https://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

DAEMON=/usr/bin/freshclam
NAME=freshclam
DESC="ClamAV virus database updater"

# required by Debian policy 9.3.2
[ -x $DAEMON ] || exit 0

CLAMAV_CONF_FILE=/etc/clamav/clamd.conf
FRESHCLAM_CONF_FILE=/etc/clamav/freshclam.conf

to_lower()
{
  word="$1"
  lcword=$(echo "$word" | tr A-Z a-z)
  echo "$lcword"
}

is_true()
{
  var="$1"
  lcvar=$(to_lower "$var")
  [ 'true' = "$lcvar" ] || [ 'yes' = "$lcvar" ] || [ 1 = "$lcvar" ]
  return $?
}

is_false()
{
  var="$1"
  lcvar=$(to_lower "$var")
  [ 'false' = "$lcvar" ] || [ 'no' = "$lcvar" ] || [ 0 = "$lcvar" ]
  return $?
}

ucf_cleanup()
{
  # This only does something if I've fucked up before
  # Not entirely impossible :(

  configfile=$1

  if [ `grep "$configfile" /var/lib/ucf/hashfile | wc -l` -gt 1 ]; then
    grep -v "$configfile" /var/lib/ucf/hashfile > /var/lib/ucf/hashfile.tmp
    grep "$configfile" /var/lib/ucf/hashfile | tail -n 1  >> /var/lib/ucf/hashfile.tmp
    mv /var/lib/ucf/hashfile.tmp /var/lib/ucf/hashfile
  fi
}

add_to_ucf()
{
  configfile=$1
  ucffile=$2

  if ! grep -q "$configfile" /var/lib/ucf/hashfile; then
    md5sum $configfile >> /var/lib/ucf/hashfile
    cp $configfile $ucffile
  fi
}

ucf_upgrade_check()
{
  configfile=$1
  sourcefile=$2
  ucffile=$3

  if [ -f "$configfile" ]; then
    add_to_ucf $configfile $ucffile
    ucf --three-way --debconf-ok "$sourcefile" "$configfile"
  else
    [ -d /var/lib/ucf/cache ] || mkdir -p /var/lib/ucf/cache
    pathfind restorecon && restorecon /var/lib/ucf/cache
    cp $sourcefile $configfile
    add_to_ucf $configfile $ucffile
  fi
}

slurp_config()
{
  CLAMAVCONF="$1"
  
  if [ -e "$CLAMAVCONF" ]; then
    for variable in `egrep -a -v '^[[:space:]]*(#|$)' "$CLAMAVCONF" | awk '{print $1}'`; do
      case "$variable" in
        DatabaseMirror)
        if [ -z "$DatabaseMirror" ]; then
          for i in `grep -a ^$variable $CLAMAVCONF | awk '{print $2}'`; do
            value="$value $i"
          done
        else
          continue
        fi
        ;;
        DatabaseCustomURL)
        if [ -z "$DatabaseCustomURL" ]; then
          for i in `grep -a ^$variable $CLAMAVCONF | awk '{print $2}'`; do
            value="$value $i"
          done
        else
          continue
        fi
        ;;
        IncludePUA)
        if [ -z "$IncludePUA" ]; then
          for i in `grep -a ^$variable $CLAMAVCONF | awk '{print $2}'`; do
            value="$i $value"
          done
        else
          continue
        fi
        ;;
        ExcludePUA)
        if [ -z "$ExcludePUA" ]; then
          for i in `grep -a ^$variable $CLAMAVCONF | awk '{print $2}'`; do
            value="$i $value"
          done
        else
          continue
        fi
        ;;
        ExtraDatabase)
        if [ -z "$ExtraDatabase" ]; then
          for i in `grep -a ^$variable $CLAMAVCONF | awk '{print $2}'`; do
            value="$value $i"
          done
        else
          continue
        fi
        ;;
        VirusEvent|OnUpdateExecute|OnErrorExecute|RejectMsg)
        value=`grep -a ^$variable $CLAMAVCONF | head -n1 | sed -e s/$variable\ //`
        ;;
        *)
        value=`grep -a "^$variable[[:space:]]" $CLAMAVCONF | head -n1 | awk '{print $2}'`
        ;;
      esac
      if [ -z "$value" ]; then 
        export "$variable"="true"
      elif [ "$value" != "$variable" ]; then
        export "$variable"="$value"
      else
        export "$variable"="true"
      fi
      unset value
    done
  fi
}

pathfind() {
  OLDIFS="$IFS"
  IFS=:
  for p in $PATH; do
    if [ -x "$p/$*" ]; then
      IFS="$OLDIFS"
      return 0
    fi
  done
  IFS="$OLDIFS"
  return 1
}

set_debconf_value()
{
prog=$1
name=$2
eval variable="\$${name}"
if [ -n "$variable" ]; then
  db_set clamav-$prog/$name "$variable" || true
fi
}

make_dir()
{
  DIR=$1
  if [ -d "$DIR" ]; then
    return 0;
  fi
  [ -n "$User" ] || User=clamav
  mkdir -p -m 0755 "$DIR"
  chown "$User" "$DIR"
  pathfind restorecon && restorecon "$DIR"
}

# Debconf Functions

isdigit ()
{
  case $1 in
    [[:digit:]]*)
    ISDIGIT=1
    ;;
    *)
    ISDIGIT=0
    ;;
  esac
}

inputdigit ()
{
  ISDIGIT=0
  while [ "$ISDIGIT" = '0' ]; do
    db_input "$1" "$2" || true
    if ! db_go; then
      return 30
    fi
    db_get $2 || true
    isdigit $RET
    if [ "$ISDIGIT" = '0' ]; then
      db_input critical clamav-base/numinfo || true
      db_go
    fi
  done
  return 0
}

StateGeneric()
{
  PRIO=$1
  QUESTION=$2
  NEXT=$3
  LAST=$4

  db_input $PRIO $QUESTION || true
  if db_go; then
    STATE=$NEXT
  else
    STATE=$LAST
  fi
}

StateGenericDigit()
{
  PRIO=$1
  QUESTION=$2
  NEXT=$3
  LAST=$4

  inputdigit $PRIO $QUESTION || true
  if db_go; then
    STATE=$NEXT
  else
    STATE=$LAST
  fi
}


. /lib/lsb/init-functions

slurp_config "$FRESHCLAM_CONF_FILE"

if [ -z "$PidFile" ]
then
  # Set the default PidFile.
  PidFile='/run/clamav/freshclam.pid'
fi
[ -n "$DataBaseDirectory" ] || DataBaseDirectory=/var/run/clamav

make_dir "$DataBaseDirectory"
make_dir $(dirname "$PidFile")

[ -z "$UpdateLogFile" ] && UpdateLogFile=/var/log/clamav/freshclam.log
[ -z "$DatabaseDirectory" ] && DatabaseDirectory=/var/lib/clamav/
[ -n "$DatabaseOwner" ] || DatabaseOwner=clamav

case "$1" in
  no-daemon)
  su "$DatabaseOwner" -p -s /bin/sh -c "freshclam -l $UpdateLogFile --datadir $DatabaseDirectory"
  ;;
  start)
  if [ ! -f "$PidFile" ]; then
    # If clamd is run under a different UID than freshclam then we need
    # to make sure the PidFile can be written or else we won't be able to
    # kill it.
    touch $PidFile
    chown $DatabaseOwner $PidFile
  fi
  # If user wants it run from cron, we only accept no-daemon and stop
  if [ -f /etc/cron.d/clamav-freshclam ]; then
    log_warning_msg "Not starting $NAME - cron option selected"
    log_warning_msg "Run the init script with the 'no-daemon' option"
    # this is similar to the daemon already running
    exit 0
  fi
  log_daemon_msg "Starting $DESC" "$NAME"
  start-stop-daemon --start --oknodo -c "$DatabaseOwner" --exec $DAEMON --pidfile $PidFile --quiet -- -d --quiet --config-file=$FRESHCLAM_CONF_FILE --pid=$PidFile
  log_end_msg $?
  ;;
  stop)
  log_daemon_msg "Stopping $DESC" "$NAME"
  start-stop-daemon --stop --oknodo --name $NAME --pidfile $PidFile --quiet --retry TERM/30/KILL/5
  log_end_msg $?
  ;;
  restart|force-reload)
  $0 stop
  $0 start
  ;;
  reload-log)
  # If user wants it run from cron, we only accept no-daemon and stop
  if [ -f /etc/cron.d/clamav-freshclam ]; then
    log_warning_msg "Not reloading log for $NAME - cron option selected"
    # log-reloading is not needed, because freshclam is not run as daemon
    exit 0
  fi
  log_daemon_msg "Reloading $DESC" "$NAME"
  pkill -HUP -F $PidFile $NAME
  log_end_msg $?
  ;;
  skip)
  ;;
  status)
  start-stop-daemon --status --name $NAME --pidfile $PidFile
  ret="$?"
   if [ "$ret" = 0 ]; then
     log_success_msg "$NAME is running"
     exit 0
   else
     log_failure_msg "$NAME is not running"
     exit "$ret"
  fi
  ;;
  *)
  log_action_msg "Usage: $0 {no-daemon|start|stop|restart|force-reload|reload-log|skip|status}" >&2
  # invalid arguments
  exit 2
  ;;
esac

exit 0

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
December 18 2025 4:18:40
root
0755
K01apache-htcacheclean
2.431 KB
October 01 2020 1:09:43
root
0755
K01clamav-daemon
9.339 KB
January 17 2022 2:19:19
root
0755
K01clamav-freshclam
7.512 KB
January 17 2022 2:19:19
root
0755
K01milter-greylist
2.879 KB
January 24 2020 11:35:02
root
0755
S01apache2
7.989 KB
October 01 2020 1:09:43
root
0755
S01atop
1.367 KB
January 25 2019 5:41:25
root
0755
S01atopacct
1.744 KB
January 25 2019 5:41:25
root
0755
S01console-setup.sh
1.203 KB
March 27 2020 11:10:06
root
0755
S01cron
2.987 KB
February 11 2020 4:43:40
root
0755
S01dbus
3.078 KB
September 30 2019 9:47:02
root
0755
S01dovecot
5.119 KB
April 11 2021 10:25:41
root
0755
S01fail2ban
6.868 KB
March 02 2020 2:20:11
root
0755
S01firewalld
2.245 KB
April 04 2020 7:50:39
root
0755
S01irqbalance
2.576 KB
December 13 2019 4:43:35
root
0755
S01lvm2-lvmpolld
0.572 KB
January 28 2020 4:44:19
root
0755
S01mysql
5.476 KB
August 19 2021 3:32:33
root
0755
S01named
3.461 KB
September 16 2020 11:20:52
root
0755
S01opendkim
3.815 KB
December 27 2019 8:52:55
root
0755
S01php5.6-fpm
4.193 KB
November 19 2021 7:39:54
root
0755
S01php7.4-fpm
4.193 KB
February 17 2022 5:06:35
root
0755
S01php8.0-fpm
4.193 KB
March 20 2022 6:04:09
root
0755
S01php8.1-fpm
4.193 KB
April 04 2022 3:30:17
root
0755
S01php8.2-fpm
4.193 KB
February 07 2023 12:28:33
root
0755
S01php8.3-fpm
4.193 KB
January 20 2024 3:16:18
root
0755
S01plymouth
1.334 KB
March 23 2020 1:06:52
root
0755
S01postfix
3.289 KB
April 16 2020 7:48:33
root
0755
S01postgrey
3.796 KB
May 09 2019 1:35:08
root
0755
S01proftpd
5.197 KB
February 27 2020 8:30:14
root
0755
S01rsync
4.313 KB
October 15 2019 2:04:36
root
0755
S01rsyslog
2.797 KB
March 07 2019 1:49:31
root
0755
S01saslauthd
10.524 KB
December 26 2019 3:48:32
root
0755
S01spamassassin
2.047 KB
February 06 2020 2:13:48
root
0755
S01ssh
3.847 KB
February 26 2020 11:55:07
root
0755
S01unattended-upgrades
1.358 KB
July 21 2020 5:20:12
root
0755
S01uuidd
1.275 KB
April 02 2020 5:29:40
root
0755
S01zabbix-agent
1.636 KB
August 21 2019 4:45:46
root
0755

NineSec Team - 2022