Status indications moved to end of some functions.

This commit is contained in:
spl 2016-05-24 18:35:46 +01:00
parent c313d7417a
commit 2670e6ee2b

View File

@ -275,12 +275,17 @@ do_overscan() {
fi fi
if [ $RET -eq 0 ] ; then if [ $RET -eq 0 ] ; then
set_config_var disable_overscan 0 $CONFIG set_config_var disable_overscan 0 $CONFIG
STATUS=enabled
elif [ $RET -eq 1 ]; then elif [ $RET -eq 1 ]; then
sed $CONFIG -i -e "s/^overscan_/#overscan_/" sed $CONFIG -i -e "s/^overscan_/#overscan_/"
set_config_var disable_overscan 1 $CONFIG set_config_var disable_overscan 1 $CONFIG
STATUS=disabled
else else
return $RET return $RET
fi fi
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "Display overscan compensation $STATUS" 20 60 1
fi
} }
do_change_pass() { do_change_pass() {
@ -585,16 +590,15 @@ do_spi() {
fi fi
set_config_var dtparam=spi $SETTING $CONFIG && set_config_var dtparam=spi $SETTING $CONFIG &&
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "The SPI interface is $STATUS" 20 60 1
fi
if ! [ -e $BLACKLIST ]; then if ! [ -e $BLACKLIST ]; then
touch $BLACKLIST touch $BLACKLIST
fi fi
sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*spi[-_]bcm2708\)/#\1/" sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*spi[-_]bcm2708\)/#\1/"
dtparam spi=$SETTING dtparam spi=$SETTING
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "The SPI interface is $STATUS" 20 60 1
fi
} }
get_i2c() { get_i2c() {
@ -627,22 +631,20 @@ do_i2c() {
fi fi
set_config_var dtparam=i2c_arm $SETTING $CONFIG && set_config_var dtparam=i2c_arm $SETTING $CONFIG &&
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "The ARM I2C interface is $STATUS" 20 60 1
fi
if ! [ -e $BLACKLIST ]; then if ! [ -e $BLACKLIST ]; then
touch $BLACKLIST touch $BLACKLIST
fi fi
sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*i2c[-_]bcm2708\)/#\1/" sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*i2c[-_]bcm2708\)/#\1/"
sed /etc/modules -i -e "s/^#[[:space:]]*\(i2c[-_]dev\)/\1/" sed /etc/modules -i -e "s/^#[[:space:]]*\(i2c[-_]dev\)/\1/"
if ! grep -q "^i2c[-_]dev" /etc/modules; then if ! grep -q "^i2c[-_]dev" /etc/modules; then
printf "i2c-dev\n" >> /etc/modules printf "i2c-dev\n" >> /etc/modules
fi fi
dtparam i2c_arm=$SETTING dtparam i2c_arm=$SETTING
modprobe i2c-dev modprobe i2c-dev
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "The ARM I2C interface is $STATUS" 20 60 1
fi
} }
get_serial() { get_serial() {
@ -916,9 +918,7 @@ do_gpiosec() {
case "$RET" in case "$RET" in
Private) Private)
rm -f /etc/systemd/system/pigpiod.service.d/public.conf rm -f /etc/systemd/system/pigpiod.service.d/public.conf
if [ "$INTERACTIVE" = True ]; then STATUS=disabled
whiptail --msgbox "Remote access to the GPIO server is disabled" 20 60 1
fi
;; ;;
Public) Public)
mkdir -p /etc/systemd/system/pigpiod.service.d/ mkdir -p /etc/systemd/system/pigpiod.service.d/
@ -927,9 +927,7 @@ do_gpiosec() {
ExecStart= ExecStart=
ExecStart=/usr/bin/pigpiod ExecStart=/usr/bin/pigpiod
EOF EOF
if [ "$INTERACTIVE" = True ]; then STATUS=enabled
whiptail --msgbox "Remote access to the GPIO server is enabled" 20 60 1
fi
;; ;;
*) *)
whiptail --msgbox "Programmer error, unrecognised option" 20 60 2 whiptail --msgbox "Programmer error, unrecognised option" 20 60 2
@ -938,6 +936,9 @@ EOF
esac esac
systemctl daemon-reload systemctl daemon-reload
systemctl restart pigpiod systemctl restart pigpiod
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "Remote access to the GPIO server is $STATUS" 20 60 1
fi
return 0 return 0
fi fi
} }
@ -1106,7 +1107,7 @@ do_gldriver() {
return 1 return 1
fi fi
if [ "$INTERACTIVE" = True ]; then if [ "$INTERACTIVE" = True ]; then
whiptail --yesno "Enable experimental GL driver for desktop?" 20 60 2 \ whiptail --yesno "Would you like the experimental GL driver for desktop to be enabled?" 20 60 2 \
--yes-button Disable --no-button Enable --yes-button Disable --no-button Enable
RET=$? RET=$?
else else