-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSolus-Toolbox.sh
More file actions
2005 lines (1889 loc) · 79.7 KB
/
Solus-Toolbox.sh
File metadata and controls
2005 lines (1889 loc) · 79.7 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
Setup(){
#Sets default editor to nano in bashrc
echo "export EDITOR=nano" | sudo tee -a /etc/bash.bashrc
#Backs up important system files
sudo cp /etc/systemd/coredump.conf /etc/systemd/coredump.conf.bak
sudo cp /etc/systemd/system.conf /etc/systemd/system.conf.bak
sudo cp /etc/systemd/logind.conf /etc/systemd/logind.conf.bak
sudo cp /etc/sudoers /etc/sudoers.bak
sudo cp /etc/login.defs /etc/login.defs.bak
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
sudo cp /etc/systemd/journald.conf /etc/systemd/journald.conf.bak
sudo cp /etc/shadow /etc/shadow.bak
sudo cp /etc/passwd /etc/passwd.bak
sudo cp /etc/bash.bashrc /etc/bash.bashrc.bak
sudo cp /etc/environment /etc/environment.bak
sudo cp /etc/profile /etc/profile.bak
sudo cp /etc/default/grub /etc/default/grub.bak
sudo cp /etc/fstab /etc/fstab.bak
sudo cp -r /boot /boot-old
cp .bashrc .bashrc.bak
cp .xsession-errors .xsession-errors.bak
#Fix screen RESOLUTION
echo "Would you like to choose a more accurate screen resolution?(Y/n)"
read answer
while [ $answer == Y ];
do
ScreenFix
break
done
#This sets up your system time.
echo "Would you like to set ntp to true? (Y/n)"
read answer
while [ $answer == Y ];
do
echo "Enter your preferred timezone"
read timezone
sudo timedatectl set-ntp true; sudo timedatectl set-timezone $timezone
break
done
#This restricts coredumps to prevent attackers from getting info
sudo sed -i -e '/#Storage=external/c\Storage=none ' /etc/systemd/coredump.conf
sudo sed -i -e '/#PermitRootLogin/c\PermitRootLogin no ' /etc/ssh/sshd_config
sudo touch /etc/sysctl.d/50-dmesg-restrict.conf
sudo touch /etc/sysctl.d/50-kptr-restrict.conf
sudo touch /etc/sysctl.d/99-sysctl.conf
sudo touch /etc/sysctl.d/60-network-hardening.conf
echo "kernel.dmesg_restrict = 1" | sudo tee -a /etc/sysctl.d/50-dmesg-restrict.conf
echo "kernel.kptr_restrict = 1" | sudo tee -a /etc/sysctl.d/50-kptr-restrict.conf
echo "vm.swappiness = 10" | sudo tee -a /etc/sysctl.d/99-sysctl.conf
echo "net.ipv4.icmp_echo_ignore_all = 1" | sudo tee -a /etc/sysctl.d/60-network-hardening.conf
sudo sed -i -e '/GRUB_TIMEOUT=5/c\GRUB_TIMEOUT=3 ' /etc/default/grub; sudo clr-boot-manager update
sudo sed -i -e '/#SystemMaxUse=/c\SystemMaxUse=50M ' /etc/systemd/journald.conf
sudo sysctl --system; sudo sysctl -p
#This disables ipv6
echo "Sometimes ipv6 can cause network issues. Would you like to disable it?(Y/n)"
read answer
if [[ $answer == Y ]];
then
sudo sed -i -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="ipv6.disable=1"/g' /etc/default/grub; sudo update-grub
else
echo "OKAY!"
fi
#This determines what type of drive you have, then offers to enable trim or write-back caching
drive=$(cat /sys/block/sda/queue/rotational)
for rota in $drive;
do
if [[ $drive == 1 ]];
then
echo "Would you like to enable write back caching?(Y/n)"
read answer
while [ $answer == Y ];
do
echo "Enter the device you'd like to enable this on."
read device
sudo hdparm -W 1 $device
break
done
elif [[ $drive == 0 ]];
then
echo "Would you like to enable Trim?(Y/n)"
read answer
while [ $answer == Y ];
do
sudo systemctl enable fstrim.timer; sudo systemctl start fstrim.timer
break
done
fi
done
#This removes that stupid gnome-keyring unlock error you get with chrome
echo "Killing this might make your passwords less secure on chrome. Do you wish to kill gnome-keyring? (Y/n)"
read answer
if [[ $answer == Y ]];
then
sudo mv /usr/bin/gnome-keyring-daemon /usr/bin/gnome-keyring-daemon-old; sudo killall gnome-keyring-daemon
else
echo "Proceeding"
fi
#This allows you to add aliases to .bashrc
echo "Would you like to add some commonly used aliases?(Y/n)"
read answer
if [[ $answer == Y ]];
then
echo "### Aliases ###" >> ~/.bashrc
echo "# Package Manager" >> ~/.bashrc
echo 'alias update="sudo eopkg -y upgrade"' >> ~/.bashrc
echo 'alias flatup="flatpak --user update"' >> ~/.bashrc
echo 'alias fix="sudo flatpak repair && flatpak --user uninstall --unused"' >> ~/.bashrc
echo 'alias cleanse="sudo eopkg -y delete-cache"' >> ~/.bashrc
echo 'alias purge="sudo eopkg -y clean"' >> ~/.bashrc
echo 'alias rmo="sudo eopkg remove-orphans"' >> ~/.bashrc
echo 'alias repair="sudo eopkg check | grep Broken | awk '{print $4}' | xargs sudo eopkg -y install --reinstall"' >> ~/.bashrc
echo 'alias rebuild="sudo eopkg -y rebuild-db"' >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# Firmware Upgrades" >> ~/.bashrc
echo 'alias fwup="sudo /usr/bin/fwupdmgr refresh && sudo /usr/bin/fwupdmgr update"' >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# System Cleaning" >> ~/.bashrc
echo 'alias vaccum="sudo journalctl --vacuum-size=25M"' >> ~/.bashrc
echo 'alias dust="sudo rm -r ~/.cache/*; sudo rm -r ~/.thumbnails/*"' >> ~/.bashrc
echo 'alias sweep="sudo rm -r ~/.config/*-old"' >> ~/.bashrc
echo 'alias mop="sudo rm -r /var/tmp/*"' >> ~/.bashrc
echo 'alias garbage="sudo rm -r ~/.local/share/Trash/files/*"' >> ~/.bashrc
echo "" ~/.bashrc
echo "# System Maintenance" >> ~/.bashrc
echo 'alias trim="sudo fstrim -v --all"' >> ~/.bashrc
echo 'alias reload="sudo systemctl daemon-reload"' >> ~/.bashrc
echo 'alias repair="sudo touch /forcefsck"' >> ~/.bashrc
echo 'alias grubup="sudo clr-boot-manager update"' >> ~/.bashrc
echo 'alias firewalld="sudo systemctl enable ufw; sudo ufw enable"' >> ~/.bashrc
echo 'alias refresh="sudo gtk-update-icon-cache"' >> ~/.bashrc
echo "" ~/.bashrc
echo "# Networking" >> ~/.bashrc
echo 'alias ipconfig="ip addr show"'
echo 'alias tracert="traceroute google.com"'
echo 'alias ping="ping -c4 google.com && ping -c4 facebook.com"'
echo 'alias netstat="ss -tulpn"'
echo 'alias query="nslookup www.google.com && host www.google.com"'
echo 'alias netinfo="hostname -I"'
echo 'alias arpinfo="arp -e"'
echo 'alias dns="dig google.com"'
echo 'alias wifi="iwconfig"'
echo "" >> ~/.bashrc
echo "# System Stats" >> ~/.bashrc
echo 'alias temp="watch sensors"' >> ~/.bashrc
echo 'alias mem="watch free -lh"' >> ~/.bashrc
echo 'alias cpu="lscpu"' >> ~/.bashrc
echo 'alias meminfo="cat /proc/meminfo"' >> ~/.bashrc
echo 'alias swaps="cat /proc/swaps"' >> ~/.bashrc
echo 'alias diskinfo="sudo smartctl -A /dev/sda"' >> ~/.bashrc
echo 'alias ut="uptime -p"' >> ~/.bashrc
echo "" ~/.bashrc
echo "# Confirmations" >> ~/.bashrc
echo 'alias mv="mv -i"' >> ~/.bashrc
echo 'alias cp="cp -i"' >> ~/.bashrc
echo 'alias rm="rm -i"' >> ~/.bashrc
echo 'alias ln="ln =i"' >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# System Permissions" >> ~/.bashrc
echo 'alias ll="ls -l"' >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# Clear Cached RAM" >> ~/.bashrc
echo 'alias boost="sudo sysctl -w vm.drop_caches=3"' >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# P2P blocking" >> ~/.bashrc
echo 'alias filter="~/bin/blocklist-update.sh"' >> ~/.bashrc
echo "" >> ~/.bashrc
echo "# Adblocking" >> ~/.bashrc
echo '#alias hostsup="sudo ./Hostsman4linux.sh -B"' >> ~/.bashrc
echo "neofetch" >> ~/.bashrc
source .bashrc
fi
checkNetwork
#This tries to update repositories and upgrade the system
sudo eopkg -y delete-cache; sudo eopkg -y clean; sudo eopkg -y rebuild-db; sudo eopkg -y upgrade
#This installs firmware updates
Firmware_Upgrades
#This optionally sets up flatpak support
#sudo eopkg install flatpak xdg-desktop-portal-gtk; sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
#This allows you to install the latest LTS kernel in Solus
echo "Would you like to install the latest LTS kernel stack?(Y/n)"
read answer
while [ $answer == Y ];
do
sudo eopkg install linux-lts linux-lts-headers
echo "This keeps your current kernel in tact"
break
done
#This starts your firewall
eopkg list-installed | grep gufw || sudo eopkg -y install gufw; sudo systemctl enable ufw; sudo ufw default deny incoming; sudo ufw default allow outgoing; sudo ufw enable
echo "Would you also like to deny ssh and telnet for security?(Y/n)"
read answer
while [ $answer == Y ]
do
sudo ufw deny ssh; sudo ufw deny telnet; sudo ufw reload
break
done
#This fixes an issue with GUFW on KDE
if [[ $DESKTOP_SESSION == /usr/share/xsessions/plasma ]];
then
echo "kdesu python3 /usr/lib/python3.7/site-packages/gufw/gufw.py" | sudo tee -a /bin/gufw
fi
#Optional
echo "Do you wish to reboot(Y/n)"
read answer
if [[ $answer == Y ]];
then
Restart
else
clear
Greeting
fi
}
Update(){
checkNetwork
sudo eopkg -y upgrade
clear
Greeting
}
Downgrade(){
checkNetwork
echo "Please enter the number to which you wish to downgrade or revert"
read number
sudo eopkg history -t $number
clear
Greeting
}
Reset(){
#This resets the desktop
eopkg list-installed | grep dconf || sudo eopkg install dconf
if [[ $DESKTOP_SESSION == budgie ]];
then
echo "############################################################################"
echo "This resets Budgie"
echo "############################################################################"
dconf dump /org/budgie/ > budgie-desktop-backup; dconf reset -f /
elif [[ $DESKTOP_SESSION == gnome ]];
then
echo "############################################################################"
echo "This resets Gnome Shell"
echo "############################################################################"
dconf dump /org/gnome/ > gnome-desktop-backup; dconf reset -f /
elif [[ $DESKTOP_SESSION == mate ]];
then
echo "############################################################################"
echo "This resets MATE"
echo "############################################################################"
dconf dump /org/mate/ > mate-desktop-backup; dconf reset -f /
else
echo "You're running a desktop/Window Manager that we do not yet support... Come back later."
fi
}
Systeminfo(){
host=$(hostname)
drive=$(df -P / | awk '{print $1}' | grep "/dev/")
DisplayManager=$(ps auxf | awk '{print $11}' | \grep --color -e dm$ -e slim$)
distribution=$(cat /etc/solus-release)
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEM INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DATE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
date >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "USER" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo $USER >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SHELL" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
which $SHELL >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DISTRIBUTION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo $distribution >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DESKTOP" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo $XDG_CURRENT_DESKTOP >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SCREEN SERVER" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo $XDG_SESSION_TYPE >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DISPLAY MANAGER" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo $DisplayManager >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEM INITIALIZATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
ps -p1 | awk 'NR!=1{print $4}' >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SCREEN RESOLUTION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
xrandr >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEM INSTALL DATE" >>$host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo tune2fs -l $drive | grep 'Filesystem created:' >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "KERNEL AND OPERATING SYSTEM INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
uname -r >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "OS/MACHINE INFO" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
hostnamectl >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "OPERATING SYSTEM RELEASE INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
lsb_release -a >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "HOSTNAME" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
hostname >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SUDO VERSION CHECK" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo -V >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "UPTIME" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
uptime -p >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "LOAD AVERAGE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
cat /proc/loadavg >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DISK SECTOR INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo fdisk -l >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DISK SPACE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
df -h >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "I/O SCHEDULER INFO" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
cat /sys/block/sda/queue/scheduler >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SMART DATA" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo smartctl -a /dev/sda >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DIRECTORY USAGE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo du -sh >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "MEMORY USAGE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
free -h >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "LISTS ALL BLOCK DEVICES WITH SIZE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
lsblk -o NAME,SIZE >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "BLOCK DEVICE ID " >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo blkid >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "NETWORK CONFIGURATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
ip addr >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "PUBLIC IP INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
curl ifconfig.me/all >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "NETWORK STATS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
ss -tulpn >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "WIFI INFO" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
iwconfig >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "DNS INFO" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
dig | grep SERVER >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "FIREWALL STATUS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo ufw status verbose >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "PROCESS TABLE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
ps -aux >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "LAST LOGIN ATTEMPTS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
lastlog >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "PERMISSIONS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
ls -larS / >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "AUDIT SUID & SGID" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo -s find / -type f \( -perm -4000 -o -perm -2000 \) -exec ls -l {} \; >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "USER AND GROUPS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
cat /etc/passwd | awk '{print $1}' >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "INSTALLED PACKAGES" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
eopkg list-installed >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "INSTALLED FLATPAKS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
flatpak list >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "PACKAGE MANAGER HISTORY" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo eopkg history >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "APPARMOR" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo apparmor_status >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "Inxi" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
inxi -F >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "CPU TEMP" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sensors >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "HD TEMP" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo hddtemp /dev/sda >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo " DRIVER INFO" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo lsmod >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "USB INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
lsusb >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "HARDWARE INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
lspci >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "MORE HARDWARE INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo lshw >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "EVEN MORE HARDWARE INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo dmidecode >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "YET STILL MORE HARDWARE INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
lscpu >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "MEMORY INFOMRATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
cat /proc/meminfo >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "TLP STATS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo tlp-stat >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "LOGS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
sudo dmesg >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "JOURNAL LOG ERRORS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
journalctl -p 3 -xb >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEMD SERVICES(ALSO FOUND IN SERVICE MANAGER)" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
systemctl list-unit-files --type=service >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEMD BOOT INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
systemd-analyze >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "MORE SYSTEMD BOOT INFORMATION" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
systemd-analyze blame >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEMD STATUS" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
systemctl status | less >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "SYSTEMD'S FAILED LIST" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
systemctl --failed >> $host-sysinfo.txt
echo "" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
echo "END OF FILE" >> $host-sysinfo.txt
echo "############################################################################" >> $host-sysinfo.txt
clear
Greeting
}
ScreenFix(){
xrandr
echo "Choose a resolution from the list above"
read resolution
xrandr -s $resolution
clear
Greeting
}
InstallAndConquer(){
checkNetwork
echo "Would you like to install software?(Y/n)"
read answer
while [ $answer == Y ];
do
echo "1 - Utility suite/Monitoring Software"
echo "2 - IDE or text/code editor"
echo "3 - Download managers"
echo "4 - Torrent clients"
echo "5 - Chat"
echo "6 - Web browser from a list"
echo "7 - Media/home theater software"
echo "8 - Virtual machine client"
echo "9 - Wine and play on linux"
echo "10 - quvcview"
echo "11 - GAMES!!!!!!!!"
echo "12 - Video editing/encoding"
echo "13 - Proprietary fonts"
echo "14 - Plank"
echo "15 - Backup"
echo "16 - THEMES!!!!!!!!"
echo "17 - screenfetch"
echo "18 - Stellarium constellation and space observation"
echo "19 - Security software"
echo "20 - exit out of this menu"
read software;
case $software in
1)
sudo eopkg install --reinstall mtr lshw hdparm tlp gparted gnome-disk-utility ncdu nmap smartmontools htop inxi gufw grsync curl net-tools
sudo eopkg install --reinstall -c traceroute ifplugd tcpdump whois iperf cpu-x system.devel linux-current-headers smem tldr autojump cmatrix
sudo snap install youtube-dl
;;
2)
echo "1 - geany"
echo "2 - bluefish"
echo "3 - atom"
echo "4 - kate"
echo "5 - Sublime-text"
read package
if [[ $package == 1 ]];
then
sudo eopkg install geany
elif [[ $package == 2 ]];
then
sudo eopkg install bluefish
elif [[ $package == 3 ]];
then
sudo eopkg install atom
elif [[ $package == 4 ]];
then
sudo eopkg install kate
elif [[ $package == 5 ]];
then
sudo eopkg bi --ignore-safety https://raw.githubusercontent.com/getsolus/3rd-party/master/programming/sublime-text-3/pspec.xml; sudo eopkg it sublime*.eopkg;sudo rm sublime*.eopkg
fi
;;
3)
echo "This installs a choice in download managers"
echo "1 - wget"
echo "2 - uget"
read software
if [[ $software == 1 ]];
then
sudo eopkg install wget
elif [[ $software == 2 ]];
then
sudo eopkg install uget
fi
;;
4)
echo "1 - transmission"
echo "2 - deluge"
echo "3 - qbittorrent"
read client
if [[ $client == 1 ]];
then
sudo eopkg install transmission && sudo ufw allow transmission && sudo ufw reload
elif [[ $client == 2 ]];
then
sudo eopkg install deluge
elif [[ $client == 3 ]];
then
sudo eopkg install qbittorrent
fi
;;
5)
echo "1 - HexChat"
echo "2 - Skype"
read package
if [[ $package == 1 ]];
then
sudo eopkg install hexchat
elif [[ $package == 2 ]];
then
sudo eopkg bi --ignore-safety https://raw.githubusercontent.com/getsolus/3rd-party/master/network/im/skype/pspec.xml; sudo eopkg it skype*.eopkg;sudo rm *.eopkg
fi
;;
6)
echo "1 - epiphany"
echo "2 - falkon"
echo "3 - midori"
echo "4 - opera"
echo "5 - lynx"
echo "6 - vivaldi"
echo "7 - vivaldi-snapshot"
echo "8 - google-chrome"
echo "9 - waterfox"
echo "10 - palemoon"
echo "11 - firefox"
echo "12 - brave"
echo "13 - LibreWolf"
read browser
if [[ $browser == 1 ]];
then
sudo eopkg install epiphany
elif [[ $browser == 2 ]];
then
sudo eopkg install falkon
elif [[ $browser == 3 ]];
then
sudo eopkg install midori
elif [[ $browser == 4 ]];
then
sudo eopkg install opera-stable
elif [[ $browser == 5 ]];
then
sudo eopkg install lynx
elif [[ $browser == 6 ]];
then
sudo eopkg install vivaldi-stable
elif [[ $browser == 7 ]];
then
sudo eopkg install vivaldi-snapshot
elif [[ $browser == 8 ]];
then
sudo eopkg bi --ignore-safety https://raw.githubusercontent.com/getsolus/3rd-party/master/network/web/browser/google-chrome-stable/pspec.xml; sudo eopkg it google-chrome-*.eopkg;sudo rm google-chrome-*.eopkg
elif [[ $browser == 9 ]];
then
wget https://cdn1.waterfox.net/waterfox/releases/G5.1.9/Linux_x86_64/waterfox-G5.1.9.tar.bz2; waterfox-G5.1.9.tar.bz2; sudo ln -s ~/waterfox/waterfox /usr/bin/waterfox; sudo mv waterfox /opt && sudo ln -s /opt/waterfox/waterfox /usr/bin/waterfox
wget https://raw.githubusercontent.com/jackrabbit335/BrowserAndDesktop/main/waterfox.desktop; sudo mv waterfox.desktop /usr/share/applications/waterfox.desktop
elif [[ $browser == 10 ]];
then
wget https://linux.palemoon.org/datastore/release/palemoon-32.3.1.linux-x86_64-gtk3.tar.xz; tar -xvf palemoon-32.3.1.linux-x86_64-gtk3.tar.xz; sudo ln -s ~/palemoon/palemoon /usr/bin/palemoon
wget https://raw.githubusercontent.com/jackrabbit335/BrowserAndDesktop/main/palemoon.desktop; sudo mv palemoon.desktop /usr/share/applications/palemoon.desktop
elif [[ $browser == 11 ]];
then
sudo eopkg install firefox
elif [[ $browser == 12 ]];
then
sudo eopkg install brave
elif [[ $browser == 13 ]];
then
flatpak install librewolf
fi
;;
7)
echo "1 - kodi"
echo "2 - spotify"
echo "3 - rhythmbox"
echo "4 - mpv"
echo "5 - smplayer"
echo "6 - VLC"
echo "7 - totem"
echo "8 - strawberry"
read player
if [[ $player == 3 ]];
then
sudo eopkg install kodi
elif [[ $player == 2 ]];
then
sudo eopkg bi --ignore-safety https://raw.githubusercontent.com/getsolus/3rd-party/master/multimedia/music/spotify/pspec.xml; sudo eopkg it spotify*.eopkg;sudo rm spotify*.eopkg
elif [[ $player == 3 ]];
then
sudo eopkg install rhythmbox
elif [[ $player == 4 ]];
then
sudo eopkg install mpv
elif [[ $player == 5 ]];
then
sudo eopkg install smplayer
elif [[ $player == 6 ]];
then
sudo eopkg install vlc
elif [[ $player == 7 ]];
then
sudo eopkg install totem
elif [[ $player == 8 ]];
then
sudo eopkg install strawberry
fi
;;
8)
sudo eopkg install virtualbox virtualbox-guest-utils
;;
9)
echo "1 - Wine"
echo "2 - playonlinux"
echo "3 - Both"
read software;
case $software in
1)
sudo eopkg install wine ;;
2)
sudo eopkg install playonlinux ;;
3)
sudo eopkg install wine playonlinux ;;
*)
echo "You have entered an invalid number"
InstallAndConquer
;;
esac
;;
10)
sudo eopkg install guvcview
;;
11)
echo "1 - supertuxkart"
echo "2 - gnome-mahjongg"
echo "3 - aisleriot"
echo "4 - ace-of-penguins"
echo "5 - gnome-sudoku"
echo "6 - gnome-mines"
echo "7 - chromium-bsu"
echo "8 - supertux"
echo "9 - everything"
read package
if [[ $package == 1 ]];
then
sudo eopkg install supertuxkart
elif [[ $package == 2 ]];
then
sudo eopkg install gnome-mahjongg
elif [[ $package == 3 ]];
then
sudo eopkg install aisleriot
elif [[ $package == 4 ]];
then
sudo eopkg install ace-of-penguins
elif [[ $package == 5 ]];
then
sudo eopkg install gnome-sudoku
elif [[ $package == 6 ]];
then
sudo eopkg install gnome-mines
elif [[ $package == 7 ]];
then
sudo eopkg install chromium-bsu
elif [[ $package == 8 ]];
then
sudo eopkg install supertux
elif [[ $package == 9 ]];
then
sudo eopkg install supertuxkart gnome-mahjongg aisleriot ace-of-penguins gnome-sudoku gnome-mines chromium-bsu supertux
fi
;;
12)
sudo eopkg install kdenlive audacity
echo "Would you also like obs-studio?(Y/n)"
read answer
while [ $answer == Y ];
do
sudo eopkg install obs-studio
break
done
;;
13)
sudo eopkg bi --ignore-safety https://raw.githubusercontent.com/getsolus/3rd-party/master/desktop/font/mscorefonts/pspec.xml; sudo eopkg it mscorefonts*.eopkg;sudo rm mscorefonts*.eopkg
;;
14)
sudo eopkg install plank
;;
15)
echo "1 - deja-dup"
echo "2 - grsync"
read package
if [[ $package == 1 ]];
then
sudo eopkg install deja-dup
elif [[ $package == 2 ]];
then
sudo eopkg install grsync
fi
;;
16)
sudo eopkg install adapta-gtk-theme moka-icon-theme mate-icon-theme-faenza faba-icon-theme numix-icon-theme arc-icon-theme evopop-icon-theme numix-gtk-theme vertex-gtk-theme arc-gtk-theme papirus-icon-theme faenza-green-icon-theme
;;
17)
sudo eopkg install screenfetch
;;
18)
sudo eopkg install stellarium
;;
19)
sudo eopkg install firejail
;;
20)
echo "Ok, well, I'm here if you change your mind"
break
;;
esac
done
read -p "Please press enter to continue..."
#This installs preload for faster load of apps
echo "Would you like to install preload?(Y/n)"
read answer
while [ $answer == Y ];
do
sudo eopkg install preload && sudo systemctl enable preload && sudo systemctl start preload
break
done
read -p "Please press enter to continue..."
#This installs microcode
cpu=$(lscpu | grep "Vendor ID:" | awk '{print $3}')
for i in cpu;
do
if [[ $cpu == GenuineIntel ]];
then
sudo eopkg li | grep intel-microcode || sudo eopkg install intel-microcode
fi
done
clear
Greeting
}
Help(){
less <<EOF
Press "q" to quit
##########################################################################
ACKNOWLEDGEMENTS
##########################################################################
I wrote these scripts and of course, I had to learn to
do some of the things in this work. Many of the ideas came from me
but the information came from various other linux users. Without their
massive contributions to the community, this project of mine would not
be possible. A list of acknowledgements below:
Joe Collins
Quidsup
SwitchedtoLinux
Matthew Moore
Chris Titus
Average Linux User
Joshua Strobl of the Solus project
Steven Black,
The creator of the other hosts lists I utilize on my own machines.
Many others...
##########################################################################
WELCOME AND RAMBLE WITH LICENSING
##########################################################################
Welcome to Solus-Toolbox. This is a useful little utility that
tries to setup, maintain, and keep up to date with the latest
software on your system. Solus-Toolbox is delivered as is and thus,
I can not be held accountable if something goes wrong. This software is
freely given under the GPL license and is distributable and changeable
as you see fit, I only ask that you give the author the credit for the
original work. Solus-Toolbox has been tested and should work on your
device assuming that you are running an Solus-based system.
A cronjob is any task or script that you place in the crontab file to be
ran at a certain time.It should be noted that Solus has
taken a slightly different approach to dealing with task scheduling.
Solus prefers to rely on Systemd. To not go to deep into it,
the basic syntax is
this:
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59) source:
http://www.adminschoice.com/crontab-quick-reference
What I normally do is set the hosts updater to run at 8 every night ex.
00 20 * * * /bin/sh /home/USER/hostsupdater.sh.
I set it up under the root account by typing su followed by my password
in manjaro, sudo -i in Ubuntu systems and then typing crontab -e.
The maintenance scripts are ok to run manually each month.
It is recommended that you do not run these without being present.
However, if you wish to run them as cron jobs then you can tweak the
cleaning routines as follows."sudo rm -r ./cache/*" should be changed to
"rm -r /home/USER/.cache/*" and etc. The setup script should only be
ran once to set the system up.
Some good reference sites are:
https://wiki.manjaro.org/index.php?title=Main_Page
https://wiki.archlinux.org
https://forum.manjaro.org
https://kaosx.us/docs/
https://getsol.us/help-center/home/
https://averagelinuxuser.com/after-installing-solus/
##########################################################################
UPDATE ROLLBACK FEATURE
##########################################################################
EOPKG in Solus provides its own rollback feature. To use this feature,
you have to know the number in the historical record of operations
in EOPKG. EOPKG records every action taken to update repos and the system
since installation. Using a simple command string like sudo eopkg history