#!/bin/bash
sync
if [ -e /tmp/scsirun ]
then
true
else
touch /tmp/scsirun
SCSI_MODULES="aic7xxx aic79xx aic7xxx_old BusLogic ncr53c8xx NCR53c406a initio advansys aha1740 aha1542 aha152x atp870u dtc eata fdomain gdth megaraid pas16 pci2220i pci2000 psi240i qlogicfas qlogicfc qlogicisp seagate t128 tmscsim u14-34f ultrastor wd7000 a100u2w 3w-xxxx ata_piix ahci"
# Misc functions
moduldir="/lib/modules/`uname -r`/kernel/drivers/scsi"
echo "Probing for SCSI cards"
# Try to load the given modules (full path or current directory)
echo "6" > /proc/sys/kernel/printk
for i in $SCSI_MODULES
do
echo -n "
Probing $i "
modprobe $i >/dev/null 2>&1
done
echo "Probing for SATA cards"
for mod in `find /lib/modules/ -type f -printf "%f\n" | grep sata | cut -d'.' -f1`
do
modprobe $mod
done
echo "0" > /proc/sys/kernel/printk
modprobe raid0 2> /dev/null
modprobe raid1 2> /dev/null
modprobe raid456 2> /dev/null
modprobe raid10 2> /dev/null
modprobe dm-mod 2> /dev/null
echo DEVICE partitions > /etc/mdadm.conf
mdadm -Ebsc partitions >> /etc/mdadm.conf
#make needed device nodes for MD
for i in `seq 0 15`
do
mknod /dev/md$i b 9 $i 2> /dev/null
done
mdadm -As 2> /dev/null
mdadm -Asc partitions 2> /dev/null
fi
id=`cat /m23clientID 2> /dev/null`
if [ $id ]
then
idvar="?m23clientID=$id"
fi
wget -T5 -t0 --post-data "type=MSR_statusBarInc&percent=75" https://192.168.1.136/postMessage.php$idvar -O /dev/null
date 112619592025.23
rm /m23clientID 2> /dev/null
cat >> /m23clientID << "m23clientIDEOF"
8
m23clientIDEOF
if [ $[ $(date +%s) - 1764187163 ] -gt 120 ] || [ $[ 1764187163 - $(date +%s) ] -gt 120 ]
then
date +%Y-%m-%d-%T -s "2025.11.26-19:59:23"
fi
mkdir -p /etc/ssl/certs
mkdir -p /usr/lib/ssl
mkdir -p /usr/local/share/ca-certificates
ln -s /etc/ssl/certs /usr/lib/ssl
wget --no-check-certificate -O/etc/ssl/certs/16325a11.0 "https://192.168.1.136/packages/baseSys/ca.crt"
if [ $? -gt 0 ]
then
wget --no-check-certificate -O/etc/ssl/certs/16325a11.0 "https://192.168.1.136/packages/baseSys/ca.crt"
fi
# Copy the certificate to CAcert
cp /etc/ssl/certs/16325a11.0 /usr/local/share/ca-certificates/m23server.crt
update-ca-certificates
wget --no-check-certificate -O/etc/ssl/certs/cb6e6f19.0 "https://192.168.1.136/packages/baseSys/ca.crt"
if [ $? -gt 0 ]
then
wget --no-check-certificate -O/etc/ssl/certs/cb6e6f19.0 "https://192.168.1.136/packages/baseSys/ca.crt"
fi
# Copy the certificate to CAcert
cp /etc/ssl/certs/cb6e6f19.0 /usr/local/share/ca-certificates/m23server.crt
update-ca-certificates
chmod -R 755 /etc/ssl/certs /usr/lib/ssl/certs /usr/local/share/ca-certificates/m23 2> /dev/null
chown -R root /etc/ssl/certs /usr/lib/ssl/certs /usr/local/share/ca-certificates/m23 2> /dev/null
chgrp -R root /etc/ssl/certs /usr/lib/ssl/certs /usr/local/share/ca-certificates/m23 2> /dev/null
if [ `grep -i 'Ubuntu 11.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 11.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 12.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 12.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 13.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 13.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 14.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 14.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 15.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 15.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 16.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 16.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 17.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 17.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 18.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 18.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 19.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 19.10' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 20.04' /etc/issue -c` -gt 0 ] || [ `grep -i 'Ubuntu 20.10' /etc/issue -c` -gt 0 ] || [ $(grep -c 'Debian GNU/Linux 13' /etc/issue) -gt 0 ] || [ $(grep -c 'Debian GNU/Linux 11' /etc/issue) -gt 0 ] || [ $(grep -c 'Debian GNU/Linux 12' /etc/issue) -gt 0 ] || ( [ $(grep 'Mint' /etc/issue -c) -gt 0 ] && [ $(sed 's/[^0-9]//g' /etc/issue) -gt 10 ] )
then
echo 'check_certificate = off' >> /etc/wgetrc
fi
if [ -e /etc/dropbear/dropbear_rsa_host_key ]
then
echo
else
mkdir -p /root/.ssh
# /etc/ssh/
chmod 700 /root/.ssh
#Make sure sshd_config exists to remove complaining
#touch /etc/ssh/sshd_config
wget -d --no-check-certificate -O - "https://192.168.1.136/packages/baseSys/authorized_keys" >> /root/.ssh/authorized_keys
sort -u /root/.ssh/authorized_keys > /root/.ssh/authorized_keys-sort
mv /root/.ssh/authorized_keys-sort /root/.ssh/authorized_keys
chmod 700 /root/.ssh/authorized_keys
chown root /root/.ssh/authorized_keys
chgrp root /root/.ssh/authorized_keys
if [ -f /etc/ssh/sshd_config ]; then
if [ -f /etc/ssh/sshd_config ]
then
userGroup=`find /etc/ssh/sshd_config -printf "chown %u:%g /etc/ssh/sshd_config"`
perm=`find /etc/ssh/sshd_config -printf "chmod %m /etc/ssh/sshd_config"`
awk -v SEARCH="ChallengeResponseAuthentication no" -v REPLACE="ChallengeResponseAuthentication yes" '{gsub(SEARCH,REPLACE); print $0} ' /etc/ssh/sshd_config > /etc/ssh/sshd_config.m23
mv /etc/ssh/sshd_config.m23 /etc/ssh/sshd_config
$userGroup
$perm
else
echo "WARNING: called EDIT_replace on non-existing file /etc/ssh/sshd_config"
fi
if [ -f /etc/ssh/sshd_config ]
then
sed -i '/PermitRootLogin/s°^\(.*\)°#\1°g' '/etc/ssh/sshd_config'
else
echo "WARNING: called EDIT_commentoutAll on non-existing file /etc/ssh/sshd_config"
fi
if [ -f /etc/ssh/sshd_config ]
then
cat >> /etc/ssh/sshd_config << "EDIT_appendToFile69275c1bc0fa3"
PermitRootLogin without-password
EDIT_appendToFile69275c1bc0fa3
else
echo "WARNING: called EDIT_appendToFile on non-existing file /etc/ssh/sshd_config"
fi
else
echo "WARNING: in CLCFG_setAuthorized_keys; cannot adapt non-existing file /etc/ssh/sshd_config"
fi
mkdir -p /etc/dropbear
dropbearkey -type rsa -f /etc/dropbear/dropbear_rsa_host_key
dropbearkey -type dss -f /etc/dropbear/dropbear_dss_host_key
cp -r /root/.ssh /
chmod 700 /.ssh /tmp /
chown root /.ssh /
dropbear
fi
if [ `uname -r | grep m23 -c` -eq 1 ]
then
echo 'root:$1$W8lfdLFQ$PYsv5HCu3kBFFvQSY8sdw.:0:0:root:/:/bin/sh' > /etc/passwd
fi
id=`cat /m23clientID 2> /dev/null`
if [ $id ]
then
idvar="?m23clientID=$id"
fi
wget -T5 -t0 --post-data "type=MSR_statusBarInc&percent=25" https://192.168.1.136/postMessage.php$idvar -O /dev/null
/bin/sh
sync