-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·32 lines (27 loc) · 1.35 KB
/
install.sh
File metadata and controls
executable file
·32 lines (27 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#Merge the config with the code, output it to csel file
echo 'Merging csel.cfg with payload...'
cat csel.cfg payload > /usr/local/bin/csel_SCORING_ENGINE_DO_NOT_TOUCH
sed -i "s/%KERNEL%/"`uname -r`"/g" /usr/local/bin/csel_SCORING_ENGINE_DO_NOT_TOUCH
sed -i "s/%INSTALLDATE%/"`date +%s`"/g" /usr/local/bin/csel_SCORING_ENGINE_DO_NOT_TOUCH
echo -e 'DONE\nInstalling csel into /usr/local/bin...'
chmod 777 /usr/local/bin/csel_SCORING_ENGINE_DO_NOT_TOUCH #Make it executable
#Check for crontab entry, add it if it doesn't exist
echo -e 'DONE\nAdding crontab entry...'
if [[ $(crontab -l -u root | grep csel) ]] ; then :; else
(crontab -l -u root ; echo "* * * * * /bin/bash /usr/local/bin/csel_SCORING_ENGINE_DO_NOT_TOUCH")| crontab -
fi
#Check for CYBER folder, create if it doesn't exist
echo -e 'DONE\nCreating /etc/CYBERPATRIOT directory for icons...'
if [ ! -d "/etc/CYBERPATRIOT_DO_NOT_REMOVE" ]
then
mkdir /etc/CYBERPATRIOT_DO_NOT_REMOVE
cp logo.png /etc/CYBERPATRIOT_DO_NOT_REMOVE/logo.png
cp iguana.png /etc/CYBERPATRIOT_DO_NOT_REMOVE/iguana.png
fi
#Fire csel to create the initial Score Report
echo -e 'DONE\nFiring csel for the first time...'
csel_SCORING_ENGINE_DO_NOT_TOUCH
#Finish up
scoreReportLoc=$( grep -Po '(?<=index=\().*?(?=\))' csel.cfg )
echo -e 'DONE\n----------------------------------\n\nScore Report is located at:' $scoreReportLoc