Add basic error handling to configure.sh
Some checks failed
Deploy to Wizard / Deploy (push) Failing after 2s

Add newline to end of test.sh
This commit is contained in:
Joey Hafner 2024-02-14 11:07:57 -08:00
parent ab450c54f6
commit 20499ead13
2 changed files with 54 additions and 11 deletions

View File

@ -8,15 +8,58 @@ source /opt/vyatta/etc/functions/script-template
configure
source test.sh
#source firewall.sh
#source interfaces.sh
#source nat.sh
#source qos.sh
#source service.sh
#source system.sh
echo "===== Configure firewall... ====="
{
source firewall.sh
} || {
echo "===== Failed to configure firewall ====="
}
echo "===== Configure interfaces... ====="
{
source interfaces.sh
} || {
echo "===== Failed to configure interfaces ====="
}
echo "===== Configure NAT... ====="
{
source nat.sh
} || {
echo "===== Failed to configure NAT ====="
}
echo "===== Configure QoS... ====="
{
source qos.sh
} || {
echo "===== Failed to configure QoS ====="
}
echo "===== Configure services... ====="
{
source service.sh
} || {
echo "===== Failed to configure services ====="
}
echo "===== Configure system... ====="
{
source system.sh
} || {
echo "===== Failed to configure system ====="
}
compare
commit
save
exit
{ # try commit, save
commit && save
} || { # catch, exit discard and print a very basic error message
exit discard
echo "Failed to commit and save the configuration."
}
exit

View File

@ -1,3 +1,3 @@
#!/bin/vbash
set system task-scheduler task update-nat-reflection interval '30'
set system task-scheduler task update-nat-reflection interval '30'