Your IP address: 192.168.1.177 Servername or IP: 192.168.1.23 (192.168.1.136) m23 version and patch level: 25.1 rock (101897) Server status

» m23 project page   » m23 forum   » Commercial support   » m23 training  
god (Log out)


Current job script: aTdeb13x64NobleLubuntux64fr
wget command to fetch the work.php file
Current contents of the work.php file

  1. #!/bin/bash
  2.  
  3. sync
  4.  
  5.         if [ -e /tmp/scsirun ]
  6.         then
  7.                 true
  8.         else
  9.                 touch /tmp/scsirun
  10.                
  11.                 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"
  12.  
  13.                 # Misc functions
  14.  
  15.                 moduldir="/lib/modules/`uname -r`/kernel/drivers/scsi"
  16.                
  17.                 echo "Probing for SCSI cards"
  18.  
  19.                 # Try to load the given modules (full path or current directory)
  20.                 echo "6" > /proc/sys/kernel/printk
  21.                 for i in $SCSI_MODULES
  22.                 do
  23.                         echo -n "
  24. Probing $i                                 "
  25.                         modprobe $i >/dev/null 2>&1
  26.                 done
  27.  
  28.                 echo "Probing for SATA cards"
  29.                 for mod in `find /lib/modules/ -type f -printf "%f\n" | grep sata | cut -d'.' -f1`
  30.                 do
  31.                         modprobe $mod
  32.                 done
  33.  
  34.                 echo "0" > /proc/sys/kernel/printk
  35.  
  36.                 modprobe raid0 2> /dev/null
  37.                 modprobe raid1 2> /dev/null
  38.                 modprobe raid456 2> /dev/null
  39.                 modprobe raid10 2> /dev/null
  40.                 modprobe dm-mod 2> /dev/null
  41.                 echo DEVICE partitions > /etc/mdadm.conf
  42.                 mdadm -Ebsc partitions >> /etc/mdadm.conf
  43.                 #make needed device nodes for MD
  44.                 for i in `seq 0 15`
  45.                 do
  46.                         mknod /dev/md$i b 9 $i 2> /dev/null
  47.                 done
  48.                 mdadm -As 2> /dev/null
  49.                 mdadm -Asc partitions 2> /dev/null
  50.         fi
  51.  
  52.  
  53.  
  54.        
  55.  
  56. id=`cat /m23clientID 2> /dev/null`
  57.  
  58. if [ $id ]
  59. then
  60.         idvar="?m23clientID=$id"
  61. fi
  62.  
  63.  
  64.  
  65.         wget  -T5 -t0 --post-data "type=MSR_statusBarInc&percent=75" https://192.168.1.136/postMessage.php$idvar -O /dev/null
  66.        
  67. date 112619592025.23
  68.  
  69. rm /m23clientID 2> /dev/null
  70. cat >> /m23clientID << "m23clientIDEOF"
  71. 8
  72. m23clientIDEOF
  73.  
  74.         if [ $[ $(date +%s) - 1764187163 ] -gt 120 ] || [ $[ 1764187163 - $(date +%s) ] -gt 120 ]
  75.         then
  76.                 date +%Y-%m-%d-%T -s "2025.11.26-19:59:23"
  77.         fi
  78.        
  79. mkdir -p /etc/ssl/certs
  80. mkdir -p /usr/lib/ssl
  81. mkdir -p /usr/local/share/ca-certificates
  82.  
  83.  
  84.  
  85. ln -s /etc/ssl/certs /usr/lib/ssl
  86.  
  87. wget  --no-check-certificate -O/etc/ssl/certs/16325a11.0 "https://192.168.1.136/packages/baseSys/ca.crt"
  88. if [ $? -gt 0 ]
  89. then
  90.         wget  --no-check-certificate -O/etc/ssl/certs/16325a11.0 "https://192.168.1.136/packages/baseSys/ca.crt"
  91. fi
  92.  
  93. # Copy the certificate to CAcert
  94. cp /etc/ssl/certs/16325a11.0 /usr/local/share/ca-certificates/m23server.crt
  95.  
  96. update-ca-certificates
  97.  
  98. wget  --no-check-certificate -O/etc/ssl/certs/cb6e6f19.0 "https://192.168.1.136/packages/baseSys/ca.crt"
  99. if [ $? -gt 0 ]
  100. then
  101.         wget  --no-check-certificate -O/etc/ssl/certs/cb6e6f19.0 "https://192.168.1.136/packages/baseSys/ca.crt"
  102. fi
  103.  
  104. # Copy the certificate to CAcert
  105. cp /etc/ssl/certs/cb6e6f19.0 /usr/local/share/ca-certificates/m23server.crt
  106.  
  107. update-ca-certificates
  108.  
  109. chmod -R 755 /etc/ssl/certs /usr/lib/ssl/certs /usr/local/share/ca-certificates/m23 2> /dev/null
  110. chown -R root /etc/ssl/certs /usr/lib/ssl/certs /usr/local/share/ca-certificates/m23 2> /dev/null
  111. chgrp -R root /etc/ssl/certs /usr/lib/ssl/certs /usr/local/share/ca-certificates/m23 2> /dev/null
  112.  
  113.  
  114.  
  115. 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 ] )
  116. then
  117.         echo 'check_certificate = off' >> /etc/wgetrc
  118. fi
  119.  
  120.  
  121. if [ -e /etc/dropbear/dropbear_rsa_host_key ]
  122. then
  123.         echo
  124. else
  125.  
  126. mkdir -p /root/.ssh
  127. # /etc/ssh/
  128. chmod 700 /root/.ssh
  129. #Make sure sshd_config exists to remove complaining
  130. #touch /etc/ssh/sshd_config
  131.  
  132. wget -d --no-check-certificate -O - "https://192.168.1.136/packages/baseSys/authorized_keys" >> /root/.ssh/authorized_keys
  133.  
  134. sort -u /root/.ssh/authorized_keys > /root/.ssh/authorized_keys-sort
  135. mv /root/.ssh/authorized_keys-sort /root/.ssh/authorized_keys
  136.  
  137. chmod 700 /root/.ssh/authorized_keys
  138. chown root /root/.ssh/authorized_keys
  139. chgrp root /root/.ssh/authorized_keys
  140.  
  141.  
  142.  
  143. if [ -f /etc/ssh/sshd_config ]; then
  144.  
  145.  
  146. if [ -f /etc/ssh/sshd_config ]
  147. then
  148.  
  149. userGroup=`find /etc/ssh/sshd_config -printf "chown %u:%g /etc/ssh/sshd_config"`
  150. perm=`find /etc/ssh/sshd_config -printf "chmod %m /etc/ssh/sshd_config"`
  151.  
  152. awk -v SEARCH="ChallengeResponseAuthentication no" -v REPLACE="ChallengeResponseAuthentication yes" '{gsub(SEARCH,REPLACE); print $0} ' /etc/ssh/sshd_config > /etc/ssh/sshd_config.m23
  153.  
  154. mv /etc/ssh/sshd_config.m23 /etc/ssh/sshd_config
  155.  
  156. $userGroup
  157. $perm
  158.  
  159. else
  160. echo "WARNING: called EDIT_replace on non-existing file /etc/ssh/sshd_config"
  161. fi
  162.  
  163.  
  164.  
  165.         if [ -f /etc/ssh/sshd_config ]
  166.         then
  167.         sed -i '/PermitRootLogin/s°^\(.*\)°#\1°g' '/etc/ssh/sshd_config'
  168.         else
  169.         echo "WARNING: called EDIT_commentoutAll on non-existing file /etc/ssh/sshd_config"
  170.         fi
  171.  
  172.        
  173.  
  174. if [ -f /etc/ssh/sshd_config ]
  175. then
  176. cat >> /etc/ssh/sshd_config << "EDIT_appendToFile69275c1bc0fa3"
  177. PermitRootLogin without-password
  178. EDIT_appendToFile69275c1bc0fa3
  179. else
  180. echo "WARNING: called EDIT_appendToFile on non-existing file /etc/ssh/sshd_config"
  181. fi
  182.  
  183.  
  184.  
  185.  
  186. else
  187.  
  188. echo "WARNING: in CLCFG_setAuthorized_keys; cannot adapt non-existing file /etc/ssh/sshd_config"
  189.  
  190. fi
  191.  
  192.  
  193. mkdir -p /etc/dropbear
  194.  
  195. dropbearkey -type rsa -f /etc/dropbear/dropbear_rsa_host_key
  196. dropbearkey -type dss -f /etc/dropbear/dropbear_dss_host_key
  197.  
  198. cp -r /root/.ssh /
  199. chmod 700 /.ssh /tmp /
  200. chown root /.ssh /
  201. dropbear
  202. fi
  203.  
  204. if [ `uname -r | grep m23 -c` -eq 1 ]
  205. then
  206. echo 'root:$1$W8lfdLFQ$PYsv5HCu3kBFFvQSY8sdw.:0:0:root:/:/bin/sh' > /etc/passwd
  207. fi
  208.  
  209.  
  210.        
  211.  
  212. id=`cat /m23clientID 2> /dev/null`
  213.  
  214. if [ $id ]
  215. then
  216.         idvar="?m23clientID=$id"
  217. fi
  218.  
  219.  
  220.  
  221.         wget  -T5 -t0 --post-data "type=MSR_statusBarInc&percent=25" https://192.168.1.136/postMessage.php$idvar -O /dev/null
  222.        
  223.                         /bin/sh
  224.                
  225. sync
  226.  


Back to control center



Help: Current job script

At this page, you can see the script which is currently being executed on the m23 client (or which is the next one to be executed) as well as the command to request the script.

You can copy the command from the text field next to "wget command to fetch the work.php file" to request and display the script. This command can simply be executed from a Linux shell.

Under "Current contents of the work.php file", you can see the source code of the script (with the syntax highlighted).