Hey, all
Need a little help with a script.
script usage: app-upgrade.sh
-l dir: app_home directory to be upgraded
-d dir: upgrade distribution dir
-c dir: tomcat_home root of app apache tomcat install
-u owner: the tomcat user account
The command string is being run from within the /usr/local/app/src/appdistdir dir.
Code:
./app-upgrade.sh -l /usr/local/app -d /usr/local/app/src/appdistdir -c /usr/share/tomcat -u tomcat --systemctl --noPrompt
The arg that needs to have a variable passed to it is this appdistdir bit because of a tarball that is downloaded and unpacked every night.
Code:
-d /usr/local/app/src/appdistdir
If I add something like...
Code:
upgrdir=$(ls -1t | head -1)
./app-upgrade.sh -l /usr/local/app -d upgrdir -c /usr/share/tomcat -u tomcat --systemctl --noPrompt
... I'm not confident it will work. That -d arg needs to have the absolute path passed to it. What is the best way to do that so it picks up the newly created dir after the tarball unpack?