Running automation tests on our CI. Currently, we are retrieving the latest versions of Chrome and Firefox as part of our setup, however, the versions of chromedriver and geckodriver we use are hardcoded because there seems to be no link to the latest version.
Ex. here is the line that downloads the latest firefox version
wget -nv -O ~/FirefoxSetup.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"
While here is the line that downloads a specific version of geckodriver
wget -nv -O ~/geckodriver.tar.gz "https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz"
Is there anyway to always get the latest chromedriver and geckodriver?
Check if this gist helps, at least for chromedriver:
version=$(curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
download_location= " http://chromedriver.storage.googleapis.com/ $version /chromedriver_linux64.zip "
rm /tmp/chromedriver_linux64.zip
wget -P /tmp $download_location
unzip /tmp/chromedriver_linux64.zip -d .
mv ./chromedriver ./chromedriver.linux
chmod u+x ./chromedriver.linux
Same idea for geckodriver:
install_dir= " /usr/local/bin "
json= $( curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest )
if [[ $( uname ) == " Darwin " ]] ; then
url= $( echo " $json " | jq -r ' .assets[].browser_download_url | select(contains("maces")) ' )
elif [[ $( uname ) == " Linux " ]] ; then
url= $( echo " $json " | jq -r ' .assets[].browser_download_url | select(contains("linux64")) ' )
else
echo " can't determine OS "
exit 1
fi
curl -s -L " $url " | tar -xz
chmod +x geckodriver
sudo mv geckodriver " $install_dir "
Related
I am getting an error when running mpirun:
will#will-MS-7D91:~/WRFHYDRO/Tests/Compatibility$ mpirun ./a.out |& tee comp_test2.txt
C function called by Fortran
Values are xx = 2.00 and ii = 1
Abort(2139535) on node 0 (rank 0 in comm 0): Fatal error in PMPI_Init: Other MPI error, error stack:
MPIR_Init_thread(176)........:
MPID_Init(1538)..............:
MPIDI_OFI_mpi_init_hook(1511):
open_fabric(2565)............:
find_provider(2683)..........: OFI fi_getinfo() failed (ofi_init.c:2683:find_provider:No data available)
I have tested the commands on another computer and it works fine. The commands are this:
echo "Test 2"
mpifort -c 02_fortran+c+netcdf+mpi_f.f
mpicc -c 02_fortran+c+netcdf+mpi_c.c
mpifort 02_fortran+c+netcdf+mpi_f.o \
02_fortran+c+netcdf+mpi_c.o \
-L${NETCDF}/lib -lnetcdff -lnetcdf
mpirun ./a.out |& tee comp_test2.txt
I recently built a new pc, with an MSI Z790 Tomahawk board, Intel-13900K cpu, and 64GB of DDR5 5600mhz RAM. Could this be this issue were one of those things are not compatibile with mpich? Mpich version is 4.0.3.
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install gcc gfortran g++ libtool automake autoconf make m4 default-jre default-jdk csh ksh git python3 python3-dev python2 python2-dev mlocate curl cmake libcurl4-openssl-dev
echo " "
##############################Directory Listing############################
export HOME=`cd;pwd`
mkdir $HOME/WRF
export WRF_FOLDER=$HOME/WRF
cd $WRF_FOLDER/
mkdir Downloads
mkdir WRFPLUS
mkdir WRFDA
mkdir Libs
export DIR=$WRF_FOLDER/Libs
mkdir Libs/grib2
mkdir Libs/NETCDF
mkdir Libs/MPICH
mkdir -p Tests/Environment
mkdir -p Tests/Compatibility
echo " "
#############################Core Management####################################
export CPU_CORE=$(nproc) # number of available threads on system
export CPU_6CORE="6"
export CPU_HALF=$(($CPU_CORE / 2)) #half of availble cores on system
export CPU_HALF_EVEN=$(( $CPU_HALF - ($CPU_HALF % 2) )) #Forces CPU cores to even number to avoid partial core export. ie 7 cores would be 3.5 cores.
if [ $CPU_CORE -le $CPU_6CORE ] #If statement for low core systems. Forces computers to only use 1 core if there are 4 cores or less on the system.
then
export CPU_HALF_EVEN="2"
else
export CPU_HALF_EVEN=$(( $CPU_HALF - ($CPU_HALF % 2) ))
fi
echo "##########################################"
echo "Number of Threads being used $CPU_HALF_EVEN"
echo "##########################################"
echo " "
##############################Downloading Libraries############################
#Force use of ipv4 with -4
cd Downloads
wget -c -4 https://github.com/madler/zlib/archive/refs/tags/v1.2.13.tar.gz
wget -c -4 https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_13_2.tar.gz
wget -c -4 https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.0.tar.gz
wget -c -4 https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.0.tar.gz
wget -c -4 https://github.com/pmodels/mpich/releases/download/v4.0.3/mpich-4.0.3.tar.gz
wget -c -4 https://download.sourceforge.net/libpng/libpng-1.6.39.tar.gz
wget -c -4 https://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip
wget -c -4 https://sourceforge.net/projects/opengrads/files/grads2/2.2.1.oga.1/Linux%20%2864%20Bits%29/opengrads-2.2.1.oga.1-bundle-x86_64-pc-linux-gnu-glibc_2.17.tar.gz
echo " "
####################################Compilers#####################################
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran
export CFLAGS="-fPIC -fPIE -O3"
#IF statement for GNU compiler issue
export GCC_VERSION=$(/usr/bin/gcc -dumpfullversion | awk '{print$1}')
export GFORTRAN_VERSION=$(/usr/bin/gfortran -dumpfullversion | awk '{print$1}')
export GPLUSPLUS_VERSION=$(/usr/bin/g++ -dumpfullversion | awk '{print$1}')
export GCC_VERSION_MAJOR_VERSION=$(echo $GCC_VERSION | awk -F. '{print $1}')
export GFORTRAN_VERSION_MAJOR_VERSION=$(echo $GFORTRAN_VERSION | awk -F. '{print $1}')
export GPLUSPLUS_VERSION_MAJOR_VERSION=$(echo $GPLUSPLUS_VERSION | awk -F. '{print $1}')
export version_10="10"
if [ $GCC_VERSION_MAJOR_VERSION -ge $version_10 ] || [ $GFORTRAN_VERSION_MAJOR_VERSION -ge $version_10 ] || [ $GPLUSPLUS_VERSION_MAJOR_VERSION -ge $version_10 ]
then
export fallow_argument=-fallow-argument-mismatch
export boz_argument=-fallow-invalid-boz
else
export fallow_argument=
export boz_argument=
fi
export FFLAGS=$fallow_argument
export FCFLAGS=$fallow_argument
echo "##########################################"
echo "FFLAGS = $FFLAGS"
echo "FCFLAGS = $FCFLAGS"
echo "##########################################"
echo " "
#############################zlib############################
#Uncalling compilers due to comfigure issue with zlib1.2.13
#With CC & CXX definied ./configure uses different compiler Flags
cd $WRF_FOLDER/Downloads
tar -xvzf v1.2.13.tar.gz
cd zlib-1.2.13/
./configure --prefix=$DIR/grib2
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
#make check
echo " "
##############################MPICH############################
#F90= due to compiler issues with mpich install
cd $WRF_FOLDER/Downloads
tar -xvzf mpich-4.0.3.tar.gz
cd mpich-4.0.3/
F90= ./configure --prefix=$DIR/MPICH --with-device=ch3 FFLAGS=$fallow_argument FCFLAGS=$fallow_argument
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
# make check
export PATH=$DIR/MPICH/bin:$PATH
export MPIFC=$DIR/MPICH/bin/mpifort
export MPIF77=$DIR/MPICH/bin/mpifort
export MPIF90=$DIR/MPICH/bin/mpifort
export MPICC=$DIR/MPICH/bin/mpicc
export MPICXX=$DIR/MPICH/bin/mpicxx
echo " "
#############################libpng############################
cd $WRF_FOLDER/Downloads
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include
tar -xvzf libpng-1.6.39.tar.gz
cd libpng-1.6.39/
CC=$MPICC FC=$MPIFC F77=$MPIF77 F90=$MPIF90 CXX=$MPICXX ./configure --prefix=$DIR/grib2
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
#make check
echo " "
#############################JasPer############################
cd $WRF_FOLDER/Downloads
unzip jasper-1.900.1.zip
cd jasper-1.900.1/
./configure --prefix=$DIR/grib2
CC=$MPICC FC=$MPIFC F77=$MPIF77 F90=$MPIF90 CXX=$MPICXX ./configure --prefix=$DIR/grib2
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
#make check
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
echo " "
#############################hdf5 library for netcdf4 functionality############################
cd $WRF_FOLDER/Downloads
tar -xvzf hdf5-1_13_2.tar.gz
cd hdf5-hdf5-1_13_2
CC=$MPICC FC=$MPIFC F77=$MPIF77 F90=$MPIF90 CXX=$MPICXX ./configure --prefix=$DIR/grib2 --with-zlib=$DIR/grib2 --enable-hl --enable-fortran
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
#make check
export HDF5=$DIR/grib2
export LD_LIBRARY_PATH=$DIR/grib2/lib:$LD_LIBRARY_PATH
echo " "
##############################Install NETCDF C Library############################
cd $WRF_FOLDER/Downloads
tar -xzvf v4.9.0.tar.gz
cd netcdf-c-4.9.0/
export CPPFLAGS=-I$DIR/grib2/include
export LDFLAGS=-L$DIR/grib2/lib
export LIBS="-lhdf5_hl -lhdf5 -lz -lcurl -lgfortran -lgcc -lm -ldl"
CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 ./configure --prefix=$DIR/NETCDF --disable-dap --enable-netcdf-4 --enable-netcdf4 --enable-shared
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
#make check
export PATH=$DIR/NETCDF/bin:$PATH
export NETCDF=$DIR/NETCDF
echo " "
##############################NetCDF fortran library############################
cd $WRF_FOLDER/Downloads
tar -xvzf v4.6.0.tar.gz
cd netcdf-fortran-4.6.0/
export LD_LIBRARY_PATH=$DIR/NETCDF/lib:$LD_LIBRARY_PATH
export CPPFLAGS="-I$DIR/NETCDF/include -I$DIR/grib2/include"
export LDFLAGS="-L$DIR/NETCDF/lib -L$DIR/grib2/lib"
export LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz -ldl"
CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 ./configure --prefix=$DIR/NETCDF --enable-netcdf-4 --enable-netcdf4 --enable-shared
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install |& tee make.install.log
#make check
echo " "
#################################### System Environment Tests ##############
cd $WRF_FOLDER/Downloads
wget -c -4 https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/Fortran_C_NETCDF_MPI_tests.tar
wget -c -4 https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/Fortran_C_tests.tar
tar -xvf Fortran_C_tests.tar -C $WRF_FOLDER/Tests/Environment
tar -xvf Fortran_C_NETCDF_MPI_tests.tar -C $WRF_FOLDER/Tests/Compatibility
export one="1"
echo " "
############## Testing Environment #####
cd $WRF_FOLDER/Tests/Environment
echo " "
echo " "
echo "Environment Testing "
echo "Test 1"
gfortran TEST_1_fortran_only_fixed.f
./a.out |& tee env_test1.txt
export TEST_PASS=$(grep -w -o -c "SUCCESS" env_test1.txt | awk '{print$1}')
if [ $TEST_PASS -ge 1 ]
then
echo "Enviroment Test 1 Passed"
else
echo "Environment Compiler Test 1 Failed"
exit
fi
read -t 3 -p "I am going to wait for 3 seconds only ..."
echo " "
echo "Test 2"
gfortran TEST_2_fortran_only_free.f90
./a.out |& tee env_test2.txt
export TEST_PASS=$(grep -w -o -c "SUCCESS" env_test2.txt | awk '{print$1}')
if [ $TEST_PASS -ge 1 ]
then
echo "Enviroment Test 2 Passed"
else
echo "Environment Compiler Test 2 Failed"
exit
fi
echo " "
read -t 3 -p "I am going to wait for 3 seconds only ..."
echo " "
echo "Test 3"
gcc TEST_3_c_only.c
./a.out |& tee env_test3.txt
export TEST_PASS=$(grep -w -o -c "SUCCESS" env_test3.txt | awk '{print$1}')
if [ $TEST_PASS -ge 1 ]
then
echo "Enviroment Test 3 Passed"
else
echo "Environment Compiler Test 3 Failed"
exit
fi
echo " "
read -t 3 -p "I am going to wait for 3 seconds only ..."
echo " "
echo "Test 4"
gcc -c -m64 TEST_4_fortran+c_c.c
gfortran -c -m64 TEST_4_fortran+c_f.f90
gfortran -m64 TEST_4_fortran+c_f.o TEST_4_fortran+c_c.o
./a.out |& tee env_test4.txt
export TEST_PASS=$(grep -w -o -c "SUCCESS" env_test4.txt | awk '{print$1}')
if [ $TEST_PASS -ge 1 ]
then
echo "Enviroment Test 4 Passed"
else
echo "Environment Compiler Test 4 Failed"
exit
fi
echo " "
read -t 3 -p "I am going to wait for 3 seconds only ..."
echo " "
############## Testing Environment #####
cd $WRF_FOLDER/Tests/Compatibility
cp ${NETCDF}/include/netcdf.inc .
echo " "
echo " "
echo "Library Compatibility Tests "
echo "Test 1"
gfortran -c 01_fortran+c+netcdf_f.f
gcc -c 01_fortran+c+netcdf_c.c
gfortran 01_fortran+c+netcdf_f.o 01_fortran+c+netcdf_c.o \
-L${NETCDF}/lib -lnetcdff -lnetcdf
./a.out |& tee comp_test1.txt
export TEST_PASS=$(grep -w -o -c "SUCCESS" comp_test1.txt | awk '{print$1}')
if [ $TEST_PASS -ge 1 ]
then
echo "Compatibility Test 1 Passed"
else
echo "Compatibility Compiler Test 1 Failed"
exit
fi
echo " "
read -t 3 -p "I am going to wait for 3 seconds only ..."
echo " "
echo "Test 2"
mpifort -c 02_fortran+c+netcdf+mpi_f.f
mpicc -c 02_fortran+c+netcdf+mpi_c.c
mpifort 02_fortran+c+netcdf+mpi_f.o \
02_fortran+c+netcdf+mpi_c.o \
-L${NETCDF}/lib -lnetcdff -lnetcdf
mpirun ./a.out |& tee comp_test2.txt
So this issue was having the intel mpi program in the $PATH and $LD_LIBRARY_PATH
Once I removed the intel mpi program from the both of those places in .bashrc it fixed the issue.
I'm working on Arch Linux OS where I use Firefox 91.10.0esr (so, Firefox ESR) and I'm looking for a way to install silently Firefox addons by using terminal. I'm aware of methods to install them by calling the downloaded addon .xpi as
firefox-esr <addon-name>.xpi but it opens Firefox and asks for a further confirmation of the installation.
My purpose is to perform the installation of the .xpi file only by command line without interact with the browser GUI and avoid the further install confirmation (the "Add" button on the popup opened by the browser).
According to several sources (i.e., https://askubuntu.com/questions/73474/how-to-install-firefox-addon-from-command-line-in-scripts) where the process is explained for addons that contain install.rdf file, it is easy to manage this case.
My issue is related to those .xpi files that don't include a install.rdf file containing the ID of the application.
For example, if we consider FoxyProxy addon and we download it and extract it:
mkdir foxyproxy && cd foxyproxy
wget https://addons.mozilla.org/firefox/downloads/file/3611407/foxyproxy_standard-7.5.1.xpi
unzip foxyproxy_standard-7.5.1.xpi
among the extracted files, there is not a install.rdf file containing the usual hexadecimal ID of the extension.
The only ID I can see is inside the manifest.json file that does not have the hexadecimal format. Taking for example FoxyProxy, I tried to use its ID foxyproxy#eric.h.jung by making the process like:
mkdir -p /usr/share/mozilla/extensions/foxyproxy#eric.h.jung
or
mkdir -p /home/user/.mozilla/extensions/foxyproxy#eric.h.jung
and then copy all the unzipped content of.xpi in one of these directories, but with no luck.
Is it possible to install by CLI this kind of addons with no install.rdf file?
TL;DR
Run this config_firefox.sh script:
#!/bin/bash
sudo mkdir -p /etc/firefox/policies
sudo cp policies.json /etc/firefox/policies/policies.json
Which copies (the following policies.json file that you have to put in the same folder as the config_firefox.sh script):
{
"policies": {
"Extensions": {
"Install": [
"https://addons.mozilla.org/firefox/downloads/file/3551054/ublock_origin-latest.xpi"
]
},
"ExtensionUpdate": true,
"DisableTelemetry": true,
"DisableFirefoxStudies": true,
"EnableTrackingProtection": {
"Value": true,
"Locked": false,
"Cryptomining": true,
"Fingerprinting": true,
"Exceptions": []
}
}
}
into: `/etc/firefox/policies/policies.json and restart Firefox. (You don't have to click "accept" anything anymore, they are automatically installed.
Answers XY-problem of question, doesn't work:
This script gets the extension ID from the manifest.json files inside the .xpi files: (However, Firefox does not automatically install the .xpi files if I export them to: /home/<username>/snap/firefox/common/.mozilla/firefox/<profilename>.default/extensions.
#!/bin/bash
# Constants
#FIREFOX_PATH=~/.mozilla/firefox
FIREFOX_PATH=~/snap/firefox/common/.mozilla/firefox/
echo "FIREFOX_PATH=$FIREFOX_PATH"
FIREFOX_PROFILE=$(cat ${FIREFOX_PATH}/profiles.ini | grep "Path=" | cut -d= -f2)
echo "FIREFOX_PROFILE=$FIREFOX_PROFILE"
FIREFOX_PROFILE_PATH=${FIREFOX_PATH}/${FIREFOX_PROFILE}
#read -p "FIREFOX_PROFILE_PATH=$FIREFOX_PROFILE_PATH"
FIREFOX_EXT_PATH=${FIREFOX_PROFILE_PATH}/extensions
#FIREFOX_EXT_PATH=${FIREFOX_PATH}/extensions
echo "FIREFOX_EXT_PATH=$FIREFOX_EXT_PATH"
mkdir -p "$FIREFOX_EXT_PATH"
install_firefox_extensions () {
echo ">>> Installing Firefox extensions ..."
mkdir -p /tmp/firefox-install-extensions
cd /tmp/firefox-install-extensions
install_extension "uBlock"\
https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/addon-607454-latest.xpi
exit 5
install_extension "uMatrix"\
https://addons.mozilla.org/firefox/downloads/latest/umatrix/addon-613250-latest.xpi
install_extension "Vimperator"\
https://addons.mozilla.org/firefox/downloads/file/450078/vimperator-latest-fx.xpi
install_extension "Tab Groups"\
https://addons.mozilla.org/firefox/downloads/latest/tab-groups-panorama/addon-671381-latest.xpi
install_extension "Cookies Manager+"\
https://addons.mozilla.org/firefox/downloads/latest/cookies-manager-plus/addon-92079-latest.xpi
rm -rf /tmp/firefox-install-extensions
}
get_rhs_of_line_till_character() {
local line=$1
local character=$2
rhs=$(cut -d "$character" -f2- <<< "$line")
echo "$rhs"
}
get_extension_id(){
local keyword="$1"
local ext_uid=$(unzip -p addon.xpi manifest.json | grep "$keyword" | head -n 1)
# If not is None, get everything after:'"id": "' and drop last quotation and comma.
if [ "$ext_uid" != "" ]; then
local first_cut=$(get_rhs_of_line_till_character "$ext_uid" ":")
#echo "first_cut=$first_cut"
local second_cut=$(get_rhs_of_line_till_character "$first_cut" '"')
#echo "second_cut=$second_cut"
local trim_tail=${second_cut::-2}
#echo "trim_tail=$trim_tail"
echo "$trim_tail"
fi
}
manual_assert_file_exists() {
local filepath="$1"
if [ ! -f "$filepath" ]; then
echo "The file: $filepath does not exist."
exit 29
fi
}
install_extension () {
local ext_name=$1
local ext_url=$2
echo ">>> Installing ${ext_name} ..."
rm addon.xpi
wget --quiet -O addon.xpi "${ext_url}"
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo ">>>> error downloading $ext_name"
fi
manual_assert_file_exists "addon.xpi"
local xpi_id=$(get_extension_id "id")
if [ "$xpi_id" == "" ]; then
xpi_id=$(get_extension_id "short_name")
fi
if [ "$xpi_id" == "" ]; then
echo "Error, did not find xpi-id for:$ext_name"
fi
echo "xpi_id=$xpi_id"
cp -f addon.xpi "${FIREFOX_EXT_PATH}/${xpi_id}.xpi"
unzip addon.xpi -d "${FIREFOX_EXT_PATH}/${xpi_id}"
}
install_firefox_extensions
#echo ">>>> changing default search to DuckDuckGo"
#while [ ! -f "$FIREFOX_PROFILE/search.json.mozlz4" ]
#do
# echo ">>>> waiting for search.json.mozlz4 to be created..."
# sleep 1
#done
I am running following script to copy files from CIFS share mounted on the system to another destination system. The absolute path of CIFS share contains few spaces and so it fails for that path, I tried running it on another path which doesn't contains spaces and it works fine. It seems some issues with the way I have declared absolute path for CIFS share:
#!/bin/bash
set -x
BASEPATH="/mnt/smbdisks/IT_linux/IT Linux Systems Dev & Support/Testing/Operation/Hello"
ADVICES="World Country State"
make_folder()
{
if [ ! -d "${1}" ]
then
echo "Warning: [${1}] Folder does not exist, trying to create..."
mkdir "$1"
if [ $? != 0 ]
then
echo "Unable to create folder "${1}" - exiting"
exit 1
fi
fi
}
sync_to_apj()
{
FROM=$1
TO=$2
TUNNEL='ssh -A -i /home/linux/.ssh/id_rsa_hostname root#hostname01.exampple.com ssh -q'
EXCLUDE='--exclude Completed --exclude Failed'
echo in folder [${BASEPATH}]
echo "Now running copying from ${FROM}/tmp/ to root#hostname01:/common/shared/test/${TO}/"
rsync -av -e "${TUNNEL}" "${BASEPATH}/${FROM}/tmp/" root#hostname01:/common/shared/test/${TO}/ ${EXCLUDE}
if [ $? != 0 ]
then
echo "Issue with rsync of $1 advices - exiting"
exit 3
fi
# Set perms to JBOSS.JBOSS on our newly copied files
echo " .. and adjusting permssions to jboss.jboss on root#hostname01:/common/shared/test"
ssh -A -i ~/.ssh/id_rsa_hostname root#hostname01 "ssh -q hostname01.example.com 'chown -R jboss.jboss /common/shared/test'"
}
# Main
echo --- START `date` - $0
echo BASEPATH = ["${BASEPATH}"]
for each_advice in ${ADVICES}
do
echo " Syncing ${each_advice}"
#DEST_ADVICE=`echo ${each_advice} | sed -e 's:$:_advices:g'`
DEST_ADVICE=`echo ${each_advice}`
make_folder "${BASEPATH}/${each_advice}/tmp"
make_folder "${BASEPATH}/${each_advice}/New"
echo "Moving pdf files from ${each_advice} to ${each_advice}/tmp"
cd "${BASEPATH}"
mv ${each_advice}/*.{PDF,pdf} ${each_advice}/tmp 2>/dev/null
sync_to_apj "${each_advice}" "${DEST_ADVICE}"
echo "Moving pdf files from ${each_advice}/tmp to ${each_advice}/New"
cd "${BASEPATH}"
mv ${each_advice}/tmp/*.{PDF,pdf} ${each_advice}/New 2>/dev/null
done
echo --- DONE `date` - $0
It fails with following error:
+ '[' '!' -d '/mnt/smbdisks/IT_linux/IT Linux Systems Dev & Support/Testing/Operation/Hello/World/tmp' ']'
+ echo 'Warning: [/mnt/smbdisks/IT_linux/IT Linux Systems Dev & Support/Testing/Operation/Hello/World/tmp] Folder does not exist, trying to create...'
+ mkdir '/mnt/smbdisks/IT_linux/IT Linux Systems Dev & Support/Testing/Operation/Hello/World/tmp'
mkdir: cannot create directory `/mnt/smbdisks/IT_linux/IT Linux Systems Dev & Support/Testing/Operation/Hello/World/tmp': No such file or directory
+ '[' 1 '!=' 0 ']'
+ echo 'Unable to create folder /mnt/smbdisks/IT_linux/IT' Linux Systems Dev '&' Support/Testing/Operation/Hello/World/tmp - exiting'
+ exit 1
I am playing with Yocto Thud 2.6.1.
I want to know which utility / program / library is responsible for producing following line:
'Poky (Yocto Project Reference Distro) 2.6.1 (none) /dev/console'
Thanks
The lines before the login are from the /etc/issue and /etc/issue.net files.
You can modify them by creating a bbappend file with your own issue and issue.net files.
Note that Yocto will still append the Poky (Yocto Project Reference Distro) 2.6.1 lines.
Taking a look at the base_file_3.0.14.bb (my current version):
BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
[...]
do_install_basefilesissue () {
if [ "${hostname}" ]; then
echo ${hostname} > ${D}${sysconfdir}/hostname
fi
install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
if [ -n "${DISTRO_NAME}" ]; then
printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
if [ -n "${DISTRO_VERSION}" ]; then
distro_version_nodate=${#'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}
printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue
printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue.net
fi
printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue
echo >> ${D}${sysconfdir}/issue
echo "%h" >> ${D}${sysconfdir}/issue.net
echo >> ${D}${sysconfdir}/issue.net
fi
}
Yo need to disable this do_install_basefileissue and set your own install instead:
base-file_%.bbappend:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_prepend = " file://issue \
file://issue.net "
BASEFILESISSUEINSTALL = "do_install_basefilesissuecustom"
do_install_basefilesissuecustom () {
install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
}
I have a shell Unix running every hour (crontab on CentOS 7).
Inside that shell, a loop read and proceed treatment for all new files find in a defined folder.
At the end of each files's treatment a CURL command is send with some parameters, for example :
curl https://aaaaaa.com/website -d param1=value1 -d param2=value2 ....
Each time the shell is run by crontab, the 1st CURL is correctly converted to a true URL and received by Apache/Tomcat, but all the others are bad. In fact the 2nd and the following CURLs seem not converted in the correct format like
https://aaaaaa.com/website?param1=value1¶m2=value2
but they are sent like
https://aaaaaa.com/website -d param1=value1 -d param2=value2
So the website is unable to treat the parameters properly.
Why the 1st command is correctly converted to a correct URL format and not the following ?
EDIT - EDIT
The part of shell :
#!/bin/bash
...
#======================================================
# FUNCTIONS
#======================================================
UpdateStatus () {
CMD_CURL="${URL_WEBSITE} -d client=CLIENT -d site=TEST -d produit=MEDIASFILES -d action=update"
CMD_CURL="${CMD_CURL} -d codecmd=UPDATE_MEDIA_STATUS"
CMD_CURL="${CMD_CURL} -d idmedia=$4"
CMD_CURL="${CMD_CURL} -d idbatch=$3"
CMD_CURL="${CMD_CURL} -d statusmedia=$2"
if [[ ! -z "$5" ]]; then
CMD_CURL="${CMD_CURL} -d filename=$5"
fi
echo " ${CMD_CURL}" >> $1
CURL_RESULT=`curl -k ${CMD_CURL}`
CURL_RESULT=`echo ${CURL_RESULT} | tr -d ' '`
echo " Result CURL = ${CURL_RESULT}" >> $1
if [ "${CURL_RESULT}" = "OK" ]; then
return 0
fi
return 1
}
#======================================================
# MAIN PROGRAM
#======================================================
echo "----- Batch in progress : `date '+%d/%m/%y - %H:%M:%S'` -----"
for file in $( ls ${DIR_FACTORY_BATCHFILES}/*.batch )
do
...
old_IFS=$IFS
while IFS=';' read <&3 F_STATUS F_FILEIN F_TYPE F_CODE F_ID F_IDPARENT F_TAGID3 F_PROF F_YEARMEDIA F_DATECOURS F_TIMEBEGINCOURS F_LANG || [[ -n "$F_STATUS $F_FILEIN $F_TYPE $F_CODE $F_ID $F_IDPARENT $F_TAGID3 $F_PROF $F_YEARMEDIA $F_DATECOURS $F_TIMEBEGINCOURS $F_LANG" && $F_STATUS ]];
do
...
UpdateStatus ${LOG_FILENAME} ${STATUS_ERROR} ${F_ID} ${F_IDPARENT}
...
done 3< $file
IFS=$Old_IFS
...
done
You need to provide the "-d" flags and values before the URL so:
curl -d param1=value1 -d param2=value2 https://aaaaaa.com/website
Moreover, this command is going to send the parameters/values as POST parameters, not query parameters. You can use the "-G" flag, possibly combined with "--url-encode" to send as query parameters, see:
https://unix.stackexchange.com/questions/86729/any-way-to-encode-the-url-in-curl-command