Skip to content

Commit

Permalink
Insert missing semi-colons
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye authored and holgerfriedrich committed May 29, 2020
1 parent 10643e0 commit bfcf7e6
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
16 changes: 8 additions & 8 deletions functions/backup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ create_backup_config() {

# don't backup SD by default as this can cause problems for large cards
if [ -n "$INTERACTIVE" ]; then
if (whiptail --title "Backup raw SD card, too ?" --yes-button "Backup SD" --no-button "Do not backup SD." --yesno "Do you want to create raw disk backups of your SD card ? Only recommended if it's 16GB or less, otherwise this can take too long. You can change this at any time by editing ${confdir}/disklist." 15 80) then
if (whiptail --title "Backup raw SD card, too ?" --yes-button "Backup SD" --no-button "Do not backup SD." --yesno "Do you want to create raw disk backups of your SD card ? Only recommended if it's 16GB or less, otherwise this can take too long. You can change this at any time by editing ${confdir}/disklist." 15 80); then
echo "${hostname} /dev/mmcblk0 comp-amraw" >>"${confdir}"/disklist
fi
fi
Expand All @@ -113,7 +113,7 @@ create_backup_config() {
introtext="${introtext}\\nFor permanent storage such as USB or NAS mounted storage, as well as for cloud based storage, we will create ${tapes} virtual containers."
fi
if [ -n "$INTERACTIVE" ]; then
if ! (whiptail --title "Storage container creation" --yes-button "Continue" --no-button "Back" --yesno "$introtext" 15 80) then echo "CANCELED"; return 0; fi
if ! (whiptail --title "Storage container creation" --yes-button "Continue" --no-button "Back" --yesno "$introtext" 15 80); then echo "CANCELED"; return 0; fi
fi

# create virtual 'tapes'
Expand All @@ -126,7 +126,7 @@ create_backup_config() {
if [ "${config}" = "openhab-local-SD" ]; then
introtext="Please insert your removable storage medium number ${counter}."
if [ -n "$INTERACTIVE" ]; then
if ! (whiptail --title "Correct SD card inserted?" --yes-button "Continue" --no-button "Back" --yesno "$introtext" 15 80) then echo "CANCELED"; return 0; fi
if ! (whiptail --title "Correct SD card inserted?" --yes-button "Continue" --no-button "Back" --yesno "$introtext" 15 80); then echo "CANCELED"; return 0; fi
/bin/su - "${backupuser}" -c "/usr/sbin/amlabel ${config} ${config}-${counter} slot ${counter}"
fi
else # AWS
Expand All @@ -152,12 +152,12 @@ amanda_setup() {
local successtext="Setup was successful. Amanda backup tool is now taking backups at 01:00. For further readings, start at http://wiki.zmanda.com/index.php/User_documentation."

if [ -n "$INTERACTIVE" ]; then
if ! (whiptail --title "Amanda backup installation" --yes-button "Yes" --no-button "No, I'll go read it" --defaultno --yesno "$querytext" 10 80) then return 0; fi
if ! (whiptail --title "Amanda backup installation" --yes-button "Yes" --no-button "No, I'll go read it" --defaultno --yesno "$querytext" 10 80); then return 0; fi
fi

if ! exim --version >&/dev/null; then
if [ -n "$INTERACTIVE" ]; then
if (whiptail --title "No exim mail transfer agent" --yes-button "Install EXIM4" --no-button "MTA already exist, ignore installation" --defaultyes --yesno "Seems exim is not installed as a mail transfer agent.\\nAmanda needs one to be able to send emails.\\nOnly choose to ignore if you know there's a working mail transfer agent other than exim on your system.\\nDo you want to continue with EXIM4 installation ?" 15 80) then
if (whiptail --title "No exim mail transfer agent" --yes-button "Install EXIM4" --no-button "MTA already exist, ignore installation" --defaultyes --yesno "Seems exim is not installed as a mail transfer agent.\\nAmanda needs one to be able to send emails.\\nOnly choose to ignore if you know there's a working mail transfer agent other than exim on your system.\\nDo you want to continue with EXIM4 installation ?" 15 80); then
exim_setup
fi
fi
Expand Down Expand Up @@ -195,7 +195,7 @@ amanda_setup() {

# no SD set based config for now, requires latest Amanda which is not available as a package yet
# if [ -n "$INTERACTIVE" ]; then
# if (whiptail --title "Create SD card set based backup" --yes-button "Yes" --no-button "No" --yesno "Setup a backup mechanism based on a locally attached SD card writer and a set of SD cards. You can also use USB sticks, BUT you must ensure that the device name to access ALWAYS is the same. This is not guaranteed if you use different USB ports." 15 80) then
# if (whiptail --title "Create SD card set based backup" --yes-button "Yes" --no-button "No" --yesno "Setup a backup mechanism based on a locally attached SD card writer and a set of SD cards. You can also use USB sticks, BUT you must ensure that the device name to access ALWAYS is the same. This is not guaranteed if you use different USB ports." 15 80); then
# config=openhab-local-SD
# sddev=$(whiptail --title "Card writer device" --inputbox "What's the device name of your SD card writer?" 10 60 3>&1 1>&2 2>&3)
# tapes=$(whiptail --title "Number of SD cards in rotation" --inputbox "How many SD cards will you have available in rotation for backup purposes ?" 10 60 3>&1 1>&2 2>&3)
Expand All @@ -205,7 +205,7 @@ amanda_setup() {
# fi

if [ -n "$INTERACTIVE" ]; then
if (whiptail --title "Create file storage area based backup" --yes-button "Yes" --no-button "No" --yesno "Setup a backup mechanism based on locally attached or NAS mounted storage." 15 80) then
if (whiptail --title "Create file storage area based backup" --yes-button "Yes" --no-button "No" --yesno "Setup a backup mechanism based on locally attached or NAS mounted storage." 15 80); then
config=openhab-dir
dir=$(whiptail --title "Storage directory" --inputbox "What's the directory to store backups into?\\nYou can specify any locally accessible directory, no matter if it's located on the internal SD card, an external USB-attached device such as a USB stick or HDD, or a NFS or CIFS share mounted off a NAS or other server in the network." 10 60 3>&1 1>&2 2>&3)
tapes=15
Expand All @@ -218,7 +218,7 @@ amanda_setup() {
fi

if [ -n "$INTERACTIVE" ]; then
if (whiptail --title "Create Amazon S3 based backup" --yes-button "Yes" --no-button "No" --yesno "Setup a backup mechanism based on Amazon Web Services. You can get 5 GB of S3 cloud storage for free on https://aws.amazon.com/. For hints see http://markelov.org/wiki/index.php?title=Backup_with_Amanda:_tape,_NAS,_Amazon_S3#Amazon_S3\\n\\nPlease setup your S3 bucket on Amazon Web Services NOW if you have not done so. Remember the name has to be unique in AWS namespace.\\nContinue with Amanda installation ?" 15 80) then
if (whiptail --title "Create Amazon S3 based backup" --yes-button "Yes" --no-button "No" --yesno "Setup a backup mechanism based on Amazon Web Services. You can get 5 GB of S3 cloud storage for free on https://aws.amazon.com/. For hints see http://markelov.org/wiki/index.php?title=Backup_with_Amanda:_tape,_NAS,_Amazon_S3#Amazon_S3\\n\\nPlease setup your S3 bucket on Amazon Web Services NOW if you have not done so. Remember the name has to be unique in AWS namespace.\\nContinue with Amanda installation ?" 15 80); then
config=openhab-AWS
S3site=$(whiptail --title "S3 bucket location site" --inputbox "Enter the S3 site (e.g. \"eu-central-1\") you want to use:" 10 60 3>&1 1>&2 2>&3)
S3bucket=$(whiptail --title "S3 bucket" --inputbox "Enter the bucket name you created on S3 to use (only the part after last : of the ARN):" 10 60 3>&1 1>&2 2>&3)
Expand Down
2 changes: 1 addition & 1 deletion functions/ext-storage.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ move_root2usb() {
fi
echo "FAILED"; return 1
fi
if ! (whiptail --title "Move system root to '$NEWROOTPART'" --yes-button "Continue" --no-button "Back" --yesno "$infotext" 22 116) then echo "CANCELED"; return 0; fi
if ! (whiptail --title "Move system root to '$NEWROOTPART'" --yes-button "Continue" --no-button "Back" --yesno "$infotext" 22 116); then echo "CANCELED"; return 0; fi

#check if system root is on partition 2 of the SD card
#since 2017-06, rasbian uses PARTUUID=.... in cmdline.txt and fstab instead of /dev/mmcblk0p2...
Expand Down
2 changes: 1 addition & 1 deletion functions/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,5 @@ tryUntil() {
echo -n ".${i}."
((i-=1))
done
return $i
return "$i"
}
10 changes: 5 additions & 5 deletions functions/influxdb+grafana.bash
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ influxdb_grafana_setup() {

echo "$(timestamp) [openHABian] Setting up InfluxDB and Grafana... "
if [ -n "$INTERACTIVE" ]; then
if ! (whiptail --title "Description, Continue?" --yes-button "Continue" --no-button "Back" --yesno "$text_intro" 15 80) then echo "CANCELED"; return 0; fi
if ! (whiptail --title "Description, Continue?" --yes-button "Continue" --no-button "Back" --yesno "$text_intro" 15 80); then echo "CANCELED"; return 0; fi
# now check if hardware is recommended for Grafana/InfluxDB, Pi0 and Pi1 are not really suited to run it in conjunction with OH
totalmemory=$(grep MemTotal /proc/meminfo |awk '{print $2}')
lowmemory=false
if [ "${totalmemory:-1000000}" -lt 900000 ]; then
lowmemory=true
if ! (whiptail --title "WARNING, Continue?" --yes-button "Continue" --no-button "Back" --yesno --defaultno "$text_lowmem" 15 80) then echo "CANCELED"; return 0; fi
if ! (whiptail --title "WARNING, Continue?" --yes-button "Continue" --no-button "Back" --yesno --defaultno "$text_lowmem" 15 80); then echo "CANCELED"; return 0; fi
fi
fi

openhab_integration=false
if [ -n "$INTERACTIVE" ]; then
text_influxDB_intro="A new InfluxDB instance can be installed locally on the openHABian system or an already running InfluxDB instance can be used. Please choose one of the options. "
if ! (whiptail --title "InfluxDB" --yes-button "Install locally" --no-button "Use existing instance" --yesno "$text_influxDB_intro" 15 80) then
if ! (whiptail --title "InfluxDB" --yes-button "Install locally" --no-button "Use existing instance" --yesno "$text_influxDB_intro" 15 80); then
text_influxDB_configure="Shall a new user and database be configured on the InfluxDB instance automatically or shall existing existing ones be used?"
if ! (whiptail --title "InfluxDB" --yes-button "Create new" --no-button "Use existing" --yesno "$text_influxDB_configure" 15 80) then
if ! (whiptail --title "InfluxDB" --yes-button "Create new" --no-button "Use existing" --yesno "$text_influxDB_configure" 15 80); then
# Existing InfluxDB - Manual configuration
influxdb_database_name=$(whiptail --title "InfluxDB" --inputbox "openHAB need to use a specific InfluxDB database. Please enter a configured InfluxDB database name:" 15 80 3>&1 1>&2 2>&3)
if [ $? = 1 ]; then echo "CANCELED"; return 0; fi
Expand Down Expand Up @@ -154,7 +154,7 @@ influxdb_grafana_setup() {
if openhab_is_running; then
text_openHAB_integration="openHAB can use InfluxDB for persistant storage. Shall InfluxDB be configured with openHAB?
(A new config file for openHAB will be created with basic settings.)"
if (whiptail --title "openHAB integration, Continue?" --yes-button "Yes" --no-button "No" --yesno "$text_openHAB_integration" 15 80) then openhab_integration=true ; fi
if (whiptail --title "openHAB integration, Continue?" --yes-button "Yes" --no-button "No" --yesno "$text_openHAB_integration" 15 80); then openhab_integration=true ; fi
else
cond_echo "openHAB is not running. InfluxDB and Grafana openHAB integration is skipped..."
fi
Expand Down
2 changes: 1 addition & 1 deletion functions/openhab.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Check the \"openHAB Release Notes\" and the official announcements to learn abou
fi

if [ -n "$INTERACTIVE" ]; then
if ! (whiptail --title "openHAB software change, Continue?" --yes-button "Continue" --no-button "Back" --yesno "$introtext" 15 80) then echo "CANCELED"; return 0; fi
if ! (whiptail --title "openHAB software change, Continue?" --yes-button "Continue" --no-button "Back" --yesno "$introtext" 15 80); then echo "CANCELED"; return 0; fi
fi

wget --no-check-certificate -qO "$RepoKey" 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab'
Expand Down
4 changes: 2 additions & 2 deletions functions/openhabian.bash
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ openhabian_update_check() {
else
echo -n "Updates available... "
introtext="Additions, improvements or fixes were added to the openHABian configuration tool. Would you like to update now and benefit from them? The update will not automatically apply changes to your system.\\n\\nUpdating is recommended."
if ! (whiptail --title "openHABian Update Available" --yes-button "Continue" --no-button "Skip" --yesno "$introtext" 15 80) then echo "SKIP"; return 0; fi
if ! (whiptail --title "openHABian Update Available" --yes-button "Continue" --no-button "Skip" --yesno "$introtext" 15 80); then echo "SKIP"; return 0; fi
echo ""
openhabian_update
fi
Expand Down Expand Up @@ -128,7 +128,7 @@ system_check_default_password() {
ua-netinst_check() {
if [ -f "/boot/config-reinstall.txt" ]; then
introtext="Attention: It was brought to our attention that the old openHABian ua-netinst based image has a problem with a lately updated Linux package.\\nIf you upgrade(d) the package 'raspberrypi-bootloader-nokernel' your Raspberry Pi will run into a Kernel Panic upon reboot!\\nDo not upgrade, do not reboot!\\nA preliminary solution is to not upgrade the system (via the Upgrade menu entry or 'apt-get upgrade') or to modify a configuration file. In the long run we would recommend to switch over to the new openHABian Raspbian based system image! This error message will keep reapearing even after you fixed the issue at hand.\\nPlease find all details regarding the issue and the resolution of it at: https://github.com/openhab/openhabian/issues/147"
if ! (whiptail --title "openHABian Raspberry Pi ua-netinst image detected" --yes-button "Continue" --no-button "Cancel" --yesno "$introtext" 20 80) then return 0; fi
if ! (whiptail --title "openHABian Raspberry Pi ua-netinst image detected" --yes-button "Continue" --no-button "Cancel" --yesno "$introtext" 20 80); then return 0; fi
fi
}

Expand Down
Loading

0 comments on commit bfcf7e6

Please sign in to comment.