summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2021-03-23 22:29:35 +0200
committerzsdc <taras@vyos.io>2021-03-23 22:29:35 +0200
commit002d01a1c7aaf93bb740e041a473ff0479ff1da3 (patch)
treef23d56dba9e1eee05ab8aad9d617f0248481bccf
parentc820e78304add61546f4d8e3898a1fb4b6edfebf (diff)
downloadvyatta-cfg-002d01a1c7aaf93bb740e041a473ff0479ff1da3.tar.gz
vyatta-cfg-002d01a1c7aaf93bb740e041a473ff0479ff1da3.zip
scripts: T3425: Make paths to custom scripts relative
In some cases, like ISO or PXE boot, the `/opt/vyatta/etc/config/` folder does not bind to `/config/`. To run scripts from the `/scripts/` subfolder paths must be relative, just like for the `config.boot` file. This commit replaces hardcoded paths to relative that use the `$vyatta_sysconfdir` as the prefix.
-rwxr-xr-xscripts/init/vyos-router20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/init/vyos-router b/scripts/init/vyos-router
index 9130307..5912733 100755
--- a/scripts/init/vyos-router
+++ b/scripts/init/vyos-router
@@ -107,35 +107,35 @@ load_bootfile ()
# execute the pre-config script
run_preconfig_script ()
{
- if [ -x /config/scripts/vyos-preconfig-bootup.script ]; then
- /config/scripts/vyos-preconfig-bootup.script
+ if [ -x $vyatta_sysconfdir/config/scripts/vyos-preconfig-bootup.script ]; then
+ $vyatta_sysconfdir/config/scripts/vyos-preconfig-bootup.script
fi
}
# execute the post-config scripts
run_postconfig_scripts ()
{
- if [ -x /config/scripts/vyatta-postconfig-bootup.script ]; then
- /config/scripts/vyatta-postconfig-bootup.script
+ if [ -x $vyatta_sysconfdir/config/scripts/vyatta-postconfig-bootup.script ]; then
+ $vyatta_sysconfdir/config/scripts/vyatta-postconfig-bootup.script
fi
- if [ -x /config/scripts/vyos-postconfig-bootup.script ]; then
- /config/scripts/vyos-postconfig-bootup.script
+ if [ -x $vyatta_sysconfdir/config/scripts/vyos-postconfig-bootup.script ]; then
+ $vyatta_sysconfdir/config/scripts/vyos-postconfig-bootup.script
fi
}
run_postupgrade_script ()
{
- if [ -f /config/.upgraded ]; then
+ if [ -f $vyatta_sysconfdir/config/.upgraded ]; then
# Run the system script
/usr/libexec/vyos/system/post-upgrade
# Run user scripts
- if [ -d /config/scripts/post-upgrade.d ]; then
- run-parts /config/scripts/post-upgrade.d
+ if [ -d $vyatta_sysconfdir/config/scripts/post-upgrade.d ]; then
+ run-parts $vyatta_sysconfdir/config/scripts/post-upgrade.d
fi
- rm -f /config/.upgraded
+ rm -f $vyatta_sysconfdir/config/.upgraded
fi
}