Skip to content

Commit

Permalink
improve progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaubart committed Jul 12, 2022
1 parent ddf511a commit e3764bf
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions meta-ov/recipes-apps/ovmenu-ng-skripts/files/transfer-xcsoar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# openvario/backup/<MAC address of eth0>/
# So you can store backups from more than one OV on the same stick!

echo ' [..........] Starting'
echo ' [#.........] Wait until "DONE !!" appears before you exit!'
echo ' [==========] Starting'
echo ' [#=========] Wait until "DONE !!" appears before you exit!'

# Provident background system buffer sync to help later syncs finish quicker
sync&
Expand Down Expand Up @@ -49,7 +49,7 @@ restore() {
rsync --recursive --mkpath --checksum --quiet --progress "$1" "$2"
test ${RSYNC_EXIT:=$?} -eq 0
then
echo " [####......] All $3 files have been restored."
echo " [####======] All $3 files have been restored."
else
>&2 echo " An rsync error $RSYNC_EXIT has occurred!"
fi
Expand All @@ -59,7 +59,7 @@ restore() {

case `basename "$0"` in
backup-system.sh)
echo ' [##........] System check ...'
echo ' [##========] System check ...'

# Store SSH status
if /bin/systemctl --quiet is-enabled dropbear.socket
Expand All @@ -81,7 +81,7 @@ backup-system.sh)
# Copy brightness setting
cat /sys/class/backlight/lcd/brightness > /home/root/brightness

echo ' [####......] Starting backup ...'
echo ' [####======] Starting backup ...'
# Copy all directories and files from list below to backup directory recursively.
# We use --checksum here due to cubieboards not having an rtc clock
if
Expand All @@ -100,18 +100,18 @@ backup-system.sh)
LISTE
test ${RSYNC_EXIT:=$?} -eq 0
then
echo ' [######....] All files and settings have been backed up.'
echo ' [######====] All files and settings have been backed up.'
else
>&2 echo " An rsync error $RSYNC_EXIT has occurred!"
fi;;

restore-xcsoar.sh)
echo ' [##........] Starting restore of XCSoar ...'
echo ' [##========] Starting restore of XCSoar ...'
# Call Shell Function defined above
restore "$USB_PATH/$BACKUP/$MAC/$XCSOAR_PATH"/ "$XCSOAR_PATH"/ XCSoar;;

restore-system.sh)
echo ' [##........] Starting restore ...'
echo ' [##========] Starting restore ...'

# Eliminate /etc/opkg backup in case it's present
rm -rf "$USB_PATH/$BACKUP/$MAC"/etc/opkg/
Expand All @@ -123,37 +123,37 @@ restore-system.sh)
case `cat /home/root/ssh-status` in
enabled)
/bin/systemctl enable --quiet --now dropbear.socket
echo " [####......] SSH has been enabled permanently.";;
echo " [####======] SSH has been enabled permanently.";;
temporary)
/bin/systemctl disable --quiet --now dropbear.socket
/bin/systemctl start --quiet --now dropbear.socket
echo " [####......] SSH has been enabled temporarily.";;
echo " [####======] SSH has been enabled temporarily.";;
disabled)
/bin/systemctl disable --quiet --now dropbear.socket
echo " [####......] SSH has been disabled.";;
echo " [####======] SSH has been disabled.";;
esac

# Restore variod and sensord status
for DAEMON in variod sensord
do
case `cat /home/root/$DAEMON-status` in
enabled) /bin/systemctl enable --quiet --now $DAEMON
echo " [#####.....] $DAEMON has been enabled.";;
echo " [#####=====] $DAEMON has been enabled.";;
disabled) /bin/systemctl disable --quiet --now $DAEMON
echo " [#####.....] $DAEMON has been disabled.";;
echo " [#####=====] $DAEMON has been disabled.";;
esac
done

# Restore brightness setting
cat /home/root/brightness > /sys/class/backlight/lcd/brightness
echo " [######....] brightness setting has been restored.";;
echo " [######====] brightness setting has been restored.";;
*)
>&2 echo 'call as backup-system.sh, restore-xcsoar.sh or restore-system.sh'
exit 1;;
esac

# Sync the system buffer to make sure all data is on disk
echo ' [#######...] Please wait a moment, synchronization is not yet complete!'
echo ' [#######===] Please wait a moment, synchronization is not yet complete!'
sync
echo ' [##########] DONE !! ---------------------------------------------------'
exit $RSYNC_EXIT

1 comment on commit e3764bf

@7lima
Copy link

@7lima 7lima commented on e3764bf Jul 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Max and Timo, for making clear for me what can be improved. I really understand it by your specific example comments about what Blaubart and me have delivered. Now I really got that there was a lack of coherence, transparency, comprehensibility and clarity.

Now I've tried to comply to these necessities by delivering a new branch
https://github.com/7lima/meta-openvario/tree/pull_request_317-branch
on which our work is separated into a handful of commits which should be all well-described and focused. Doing this segmentation of aspects of the code changes I've noticed how important it is to cleanly separate, assemble and describe what has been done - by myself. This was even harder to do at the end of several weeks of collaborative work and about 80 commits that have been produced in a continuous extension and refactoring process.

The results on the branch are the same as before but they hopefully are easier to comprehend and to judge. Note that when you walk though it then just the 7 commits from today are relevant.

I guess @Blaubart will do a new follow-up PR from this one. Thank you all for your partnership!

Please sign in to comment.