| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 | #!/bin/sh# author : bachir soussi chiadmi# date : 10/06/2016function install(){  _cwd="$(pwd)"  # candy  echo 'ILoveCandy (pacman)'  sed -i.back 's/.*\[options\].*/&\nILoveCandy/' /etc/pacman.conf  sed -i.back 's/^#Color$/Color/' /etc/pacman.conf  sed -i.back 's/^#TotalDownload$/TotalDownload/' /etc/pacman.conf  # update systeme  pacman -Syyu  # install basic packages  pacman -S --needed --noconfirm vim rsync wget tmux  # configure vim  echo 'vim configuration'  pacman -S --needed --noconfirm vim-{spell-fr,spell-en,nerdtree,supertab,systemd}  cp -r $_cwp/assets/vim /home/$USER/.vim  cp $_cwd/assets/vimrc /home/$USER/.vimrc  cp -r $_cwd/assets/vim /root/.vim  cp $_cwd/assets/vimrc /root/.vimrc  # configure git  echo 'Git Completion'  pacman -S --needed --noconfirm bash-completion  mkdir /etc/bash_completion.d  wget -O /etc/bash_completion.d/git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash  # yaourt  # only needed for pynmea2 and python-picamera  # pacman -S --needed --noconfirm base-devel  # mkdir -p /home/$USER/build-repos  # wget -O /home/$USER/build-repos/package-query.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz  # wget -O /home/$USER/build-repos/yaourt.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz  # cd /home/$USER/build-repos  # tar -xvf package-query.tar.gz  # tar -xvf yaourt.tar.gz  # cd package-query  # makepkg -srif --noconfirm --needed  # cd ../yaourt  # makepkg -srif --noconfirm --needed  # echo "EDITFILES=1" >> ~/.yaourtrc  # cd $_cwd  # echo "Yaourt install complete!"  # bash & prompt  echo 'Bash and Prompt (liquidprompt)'  git clone https://github.com/nojhan/liquidprompt.git -o github /home/$USER/.liquidprompt  cp $_cwd/assets/bash_profile /home/$USER/.bash_profile  cp $_cwd/assets/bashrc /home/$USER/.bashrc  mkdir /home/$USER/.config  cp $_cwd/assets/config/liquidpromptrc /home/$USER/.config/  source /home/$USER/.bashrc  # hostname  echo 'set hostname'  hostnamectl set-hostname pi-hotspot-4G  sed -i 's/localhost$/&\tpi-hotspot-4G/' /etc/hosts  sed -i 's/^hostname$/&\tpi-hotspot-4G/' /etc/dhcpcd.conf  # avahi  # echo "install avahi"  # pacman -S --needed --noconfirm avahi nss-mdns  # echo "configure avahi"  # systemctl enable avahi-daemon  # systemctl start avahi-deamon  # sed -i 's/hosts: files dns myhostname/hosts: files mdns_minimal [NOTFOUND=return] dns hehe-rail-rover/' /etc/nsswitch.conf  # disable bluetooth  cp $_cwd/assets/rpi-wifi-blacklist.conf /ect/modprod.d/  # gsm  # http://www.linuxforums.org.uk/index.php?topic=1272.0  # http://ubuntuforums.org/showthread.php?t=857515&p=6762696#post6762696  # 06 81 82 74 27  echo 'install gsm 3G tools'  # HUAWEI E3372  sh -c 'echo "max_usb_current=1" >> /boot/config.txt'  pacman -S --needed --noconfirm usb_modeswitch ifplugd  # before : Bus 001 Device 004: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)  # after Bus 001 Device 006: ID 12d1:14dc Huawei Technologies Co., Ltd.  # eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000  #  link/ether 0c:5b:8f:27:9a:64 brd ff:ff:ff:ff:ff:ff  # LTE HUAWEI  echo "copy lte huawei netctl profile"  cp $_cwd/assets/netctl/huawei /etc/netctl/  cp $_cwd/assets/netctl/synchook /etc/netctl/hooks/  echo "enable and start auto lte connection service"  cp $_cwd/assets/services/lteconnect.service /etc/systemd/system/  systemctl enable lteconnect.service  # HOTSPOT WIFI  echo "enable and start hotspot wifi netctl profile"  cp $_cwd/assets/netctl/wifihotspot /etc/netctl/  netctl enable wifihotspot  netctl start wifihotspot  echo "enable and start auto kill wifi service"  cp $_cwd/assets/services/autokillwifi.service /etc/systemd/system/  systemctl enable autokillwifi.service  # dyndns  # yaourt -S --needed --noconfirm noip  # noip2 -C -Y}timedatectl set-ntp truetimedatectl set-timezone Europe/Paris# use tee to record all the install script output on logfile while keeping it on console# http://www.coderanch.com/t/419711/Linux-UNIX/capture-shell-scripts-ouput-lognow=$(date +"%Y-%m-%d--%T")logfile="/home/$USER/pi_hotspot-4G-$now.log"touch $logfileinstall | tee $logfile
 |