Add set -eu to all files

This commit is contained in:
Yuichiro Tsuchiya 2019-07-05 19:48:25 +09:00
parent 444c91beea
commit 9e600a56a7
22 changed files with 52 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
dev=`grep -rn "Option" /usr/share/X11/xorg.conf.d/99-fbturbo.conf | grep "fbdev" |awk -F\" '{printf $4}'` 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 if test "$dev" = "/dev/fb0";then
echo "The system is already output for HDMI and does not need to be set up any more" echo "The system is already output for HDMI and does not need to be set up any more"

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'` root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'` root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'` root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir -p /etc/X11/xorg.conf.d sudo mkdir -p /etc/X11/xorg.conf.d
sudo cp ./usr/mhs24-overlay.dtb /boot/overlays/ sudo cp ./usr/mhs24-overlay.dtb /boot/overlays/

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir -p /etc/X11/xorg.conf.d sudo mkdir -p /etc/X11/xorg.conf.d
sudo cp ./usr/mis35-overlay.dtb /boot/overlays/ sudo cp ./usr/mis35-overlay.dtb /boot/overlays/

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
hw_version=`tr -d '\0' < /proc/device-tree/model` hw_version=`tr -d '\0' < /proc/device-tree/model`

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo cp -rf ./boot/config-35-480X320.txt /boot/config.txt sudo cp -rf ./boot/config-35-480X320.txt /boot/config.txt
if [ -b /dev/mmcblk0p7 ]; then if [ -b /dev/mmcblk0p7 ]; then

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo cp -rf ./boot/config-35DPI.txt /boot/config.txt sudo cp -rf ./boot/config-35DPI.txt /boot/config.txt
#sudo cp ./usr/bcm2709-rpi-2-b.dtb /boot/ #sudo cp ./usr/bcm2709-rpi-2-b.dtb /boot/
#sudo cp ./usr/bcm2710-rpi-3-b.dtb /boot/ #sudo cp ./usr/bcm2710-rpi-3-b.dtb /boot/

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'` root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
sudo ./system_backup.sh sudo ./system_backup.sh
root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'` root_dev=`grep -oPr "root=[^\s]*" /boot/cmdline.txt | awk -F= '{printf $NF}'`

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
cur_dir=`pwd` cur_dir=`pwd`
if [ ! -f $cur_dir/.have_installed ]; then if [ ! -f $cur_dir/.have_installed ]; then
echo "Please install the LCD driver first" echo "Please install the LCD driver first"

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
if [ ! -d "./.system_backup" ]; then if [ ! -d "./.system_backup" ]; then
sudo mkdir ./.system_backup sudo mkdir ./.system_backup
fi fi

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu
#Just finished the system, no need to restore #Just finished the system, no need to restore
if [ ! -d "./.system_backup" ]; then if [ ! -d "./.system_backup" ]; then
echo "The system is the original version and does not need to be restored" echo "The system is the original version and does not need to be restored"