i'm trying to write a script to automate the install of TV card drivers (for some reason i have to re-install after each ubuntu update).

Would this work? I've tried it but it doesn't look like it's doing anything.....

#/!bin/bash
# script to reinstall TV card drivers...

function install() {

wget http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v140707.zip
mkdir driver
mv tbs-linux-drivers_v140707.zip ./driver/
cd driver/
tar xjvf linux-tbs-drivers.tar.bz2
cd linux-tbs-drivers/
./v4l/tbs-x86_r3.sh
sudo make
sudo make install
shutdown -r now

}
share|improve this question
    
Did you got any error? – AFSHIN Aug 31 '14 at 12:37
    
no errors of any kind when i do ./SetupTVDrivers – KP65 Aug 31 '14 at 12:38
4  
You forgot to call your function install at the end of or script. But, better to not use any function, just the code inside of it. – Radu Rădeanu Aug 31 '14 at 12:38
    
Also you have downloaded .zip file when you extract .tar.bz2 file. – AFSHIN Aug 31 '14 at 12:44
    
@RaduRădeanu post that as an answer. – Alaa Ali Aug 31 '14 at 12:46
  1. Not every update, but every kernel update, that is why ubuntu uses DKMS for automatic compilation of modules for new kernels.

  2. As @Radu Rădeanu wrote you didn't call install function.

  3. To unpack archive in a script use tar xf archivename

  4. use make && sudo make install && sudo shutdown -r now, because if make fails your script will still try to install those drivers and restart system. It is also a good idea to use make clean before compiling.

  5. You don't have to download drivers every time, just put them in /usr/local/src/

share|improve this answer
    
Make shouldn't need sudo, only make install should. Also, put local stuff in /usr/local. – muru Aug 31 '14 at 14:26
    
Are drivers considered local stuff? Kernel and kernel modules are usually put in /usr/src, even by module-assistant. – przemo Aug 31 '14 at 14:28
    
not drivers per se, but stuff that the user is downloading and adding. /usr/local is meant for that sort of thing, and is in general off-limits to packages in the repository, so no package will interfere. The make install of course will still go to /usr. – muru Aug 31 '14 at 14:31
    
Good point, never had this sort of problem because I usually use /root/src, it makes system migration go smoother. All I need is to backup /root/ folder. – przemo Aug 31 '14 at 14:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.