I have a script which basically has a function and then I am running the an if to run the function if the kernel version is the version I need. The script in short looks like this
#!/bin/bash
postinstall() {
run some postinstall commands in here
}
UNAME=`name -r`
if [[ $UNAME == 3.* ]]
then
postinstall
else
echo "Kernel version is not correct"
fi
When I run the commands on CLI everything it works but when I trigger the script as sh I get the following result:
: 313: <scriptname>.sh: [[: not found
Kernel version is not correct
line 313 is the one with the "if"
Aucun commentaire:
Enregistrer un commentaire