Add basic error handling to configure.sh
Some checks failed
Deploy to Wizard / Deploy (push) Failing after 2s
Some checks failed
Deploy to Wizard / Deploy (push) Failing after 2s
Add newline to end of test.sh
This commit is contained in:
parent
ab450c54f6
commit
20499ead13
@ -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
|
||||
|
||||
{ # 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
|
Loading…
Reference in New Issue
Block a user