Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add set -eu to all files #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LCD-hdmi
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

dev=`grep -rn "Option" /usr/share/X11/xorg.conf.d/99-fbturbo.conf | grep "fbdev" |awk -F\" '{printf $4}'`
if test "$dev" = "/dev/fb0";then
echo "The system is already output for HDMI and does not need to be set up any more"
Expand Down
2 changes: 2 additions & 0 deletions LCD24-3A+-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions LCD24-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions LCD28-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions LCD32-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions LCD35-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions LCD5-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`
Expand Down
2 changes: 2 additions & 0 deletions LCD7B-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`
Expand Down
2 changes: 2 additions & 0 deletions LCD7C-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`
Expand Down
3 changes: 3 additions & 0 deletions MHS24-show
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir -p /etc/X11/xorg.conf.d
sudo cp ./usr/mhs24-overlay.dtb /boot/overlays/
Expand Down
2 changes: 2 additions & 0 deletions MHS32-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions MHS35-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
2 changes: 2 additions & 0 deletions MHS40-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down
3 changes: 3 additions & 0 deletions MIS35-show
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir -p /etc/X11/xorg.conf.d
sudo cp ./usr/mis35-overlay.dtb /boot/overlays/
Expand Down
3 changes: 3 additions & 0 deletions MPI3508-show
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

hw_version=`tr -d '\0' < /proc/device-tree/model`
Expand Down
3 changes: 3 additions & 0 deletions MPI3508_480_320-show
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo cp -rf ./boot/config-35-480X320.txt /boot/config.txt
if [ -b /dev/mmcblk0p7 ]; then
Expand Down
3 changes: 3 additions & 0 deletions MPI3510-show
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

sudo cp -rf ./boot/config-35DPI.txt /boot/config.txt
#sudo cp ./usr/bcm2709-rpi-2-b.dtb /boot/
#sudo cp ./usr/bcm2710-rpi-3-b.dtb /boot/
Expand Down
2 changes: 2 additions & 0 deletions MPI4008-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`
Expand Down
2 changes: 2 additions & 0 deletions MPI5001-show
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu

sudo ./system_backup.sh

root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`
Expand Down
3 changes: 3 additions & 0 deletions rotate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

cur_dir=`pwd`
if [ ! -f $cur_dir/.have_installed ]; then
echo "Please install the LCD driver first"
Expand Down
5 changes: 4 additions & 1 deletion system_backup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

if [ ! -d "./.system_backup" ]; then
sudo mkdir ./.system_backup
fi
Expand Down Expand Up @@ -55,7 +58,7 @@ sudo cp -rf /etc/inittab ./.system_backup
sudo rm -rf /etc/inittab
fi

type fbcp > /dev/null 2>&1
type fbcp > /dev/null 2>&1 && :
if [ $? -eq 0 ]; then
sudo touch ./.system_backup/have_fbcp
sudo rm -rf /usr/local/bin/fbcp
Expand Down
3 changes: 3 additions & 0 deletions system_restore.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eu

#Just finished the system, no need to restore
if [ ! -d "./.system_backup" ]; then
echo "The system is the original version and does not need to be restored"
Expand Down