2 Commits 48511f9523 ... 2a38fa38a6

Autore SHA1 Messaggio Data
  megavolt 2a38fa38a6 Add System Load Time 2 anni fa
  megavolt 48511f9523 Add pipe detection due read input 2 anni fa
2 ha cambiato i file con 31 aggiunte e 12 eliminazioni
  1. 0 7
      fix-gpg-pacman.sh
  2. 31 5
      lognconf-report.sh

+ 0 - 7
fix-gpg-pacman.sh

@@ -4,13 +4,6 @@ set -o errexit  #>Exit when a command fails (returns non-zero)
 set -o pipefail #>Exit when a command within a pipeline fail (returns non-zero)
 set -o nounset  #>Forbid to use unset
 
-if [[ ! -t 0 ]] ; then 
-	echo "Pipe detected!"
-	echo "Please don't pipe the script. Run it like that:"
-	echo "bash <(curl -s "https://notabug.org/megavolt/random-scripts/raw/master/fix-gpg-pacman.sh")"
-   	exit
-fi
-
 # Reset language to default
 export LANG=C
 

+ 31 - 5
lognconf-report.sh

@@ -7,6 +7,7 @@ set -o nounset  #>Forbid to use unse
 declare -A Paths
 Paths[sys]="$HOME"/lognconf_systeminfo.md
 Paths[log]="$HOME"/lognconf_logging.md
+Paths[plot]="$HOME"/lognconf_plot.svg
 Paths[url]="https://notabug.org/megavolt/random-scripts/raw/master/lognconf-report.sh"
 
 if [[ ! -t 0 ]] ; then 
@@ -117,7 +118,7 @@ function GetBlockDevices ()
 
 function GetSystemJournals () 
 {
-	choice=$1
+	local choice=$1
 	if [[ -x "/usr/bin/journalctl" ]]; then
 		if   [[ $choice == "current" ]]; then
 			journalctl --boot 0 --no-hostname --no-pager
@@ -127,27 +128,51 @@ function GetSystemJournals ()
 	fi
 }
 
+function GetSystemLoadTime ()
+{
+	local choice=$1
+	if [[ -x "/usr/bin/systemd-analyze" ]]; then
+		if   [[ $choice == "svg" ]]; then
+			systemd-analyze plot
+		elif [[ $choice == "blame" ]]; then
+			systemd-analyze blame
+		elif [[ $choice == "basic" ]]; then
+			systemd-analyze
+		fi
+	fi
+}
+
 function upload ()
 {
-	local SYS=$(echo -e "${OutPut}" | curl -s -F'file=@-' https://0x0.st)
-	local PLD=$(echo -e "${Logs}" | curl -s -F'file=@-' https://0x0.st)
-	echo "Systeminfo: $SYS"
-	echo "Logs: $PLD"
+	echo "Systeminfo: $(echo -e "${OutPut}" | curl -s -F'file=@-' https://0x0.st)"
+	echo "Logs: $(echo -e "${Logs}" | curl -s -F'file=@-' https://0x0.st)"
+	echo "Plot: $(echo -e "${Plot}" | curl -s -F'file=@-' https://0x0.st)"
 }
 
 function save ()
 {
 	echo -e "${OutPut}" > "${Paths[sys]}"
 	echo -e "${Logs}" > "${Paths[log]}"
+	echo -e "${Plot}" > "${Paths[plot]}"
+	#cp /tmp/plot.svg "${Paths[plot]"
 	echo "The output was saved here:"
 	echo -e "Systeminfo -> ${Paths[sys]}"
 	echo -e "Logs -> ${Paths[log]}"
+	echo -e "Plot -> ${Paths[plot]}"
+
 }
 
 echo "Collecting INXI output..."
 InPut="$(GetINXI)"
 [[ -n "${InPut}" ]] && OutPut+="\n### INXI\n\n~~~\n${InPut}\n~~~\n\n"
 
+echo "Collecting System Load Time output..."
+InPut="$(GetSystemLoadTime basic)"
+[[ -n "${InPut}" ]] && OutPut+="\n### System Load Time\n\n~~~\n${InPut}\n~~~\n\n"
+InPut="$(GetSystemLoadTime blame)"
+[[ -n "${InPut}" ]] && OutPut+="\n#### Blamed Services\n\n~~~\n${InPut}\n~~~\n\n"
+Plot=$(GetSystemLoadTime svg)
+
 echo "Collecting Manjaro Hardware Detection output..."
 # Graphics
 InPut="$(MHWDGetGPU list)"
@@ -169,6 +194,7 @@ InPut="$(GetBootConfigs)"
 [[ -n "${InPut}" ]] && OutPut+="\n\n### Boot Configuration Files\n\n${InPut}\n\n"
 
 Logs=""
+
 echo "Collecting Xorg Logging Files..."
 InPut="$(GetXorgLogs)"
 [[ -n "${InPut}" ]] && Logs+="\n\n### Xorg Logging Files\n\n${InPut}\n\n"