added script from hehe.centiped box

This commit is contained in:
Bachir Soussi Chiadmi
2017-06-15 15:45:47 +02:00
parent 18d0ca6587
commit 6afaabe7b0
23 changed files with 627 additions and 1 deletions
+14 -1
View File
@@ -1,2 +1,15 @@
# pi_hotspot_4G
autonomous raspberry pi hotspot 4G based on arch arm
====================================================
HUAWEI E3372
# install
install arch linux arm on rpi
following this [tutorial](https://archlinuxarm.org/platforms/armv6/raspberry-pi)
plug an ethernet cable with internet access on the pi
boot the pi and connect with ssh (use nmap to find the pi ip)
install git ```pacman -S git```
+1
View File
@@ -0,0 +1 @@
KERNEL=="i2c-[0-9]*", GROUP="i2c"
+5
View File
@@ -0,0 +1,5 @@
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
+42
View File
@@ -0,0 +1,42 @@
#-------------------------------------------------------------
# Source global definitions (if any)
#-------------------------------------------------------------
if [ -f /etc/bashrc ]; then
. /etc/bashrc # --> Read /etc/bashrc, if present.
fi
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
export EDITOR=vim
export TERM=xterm-256color
# https://wiki.archlinux.org/index.php/Bash#Additional_programs_and_options_manually
complete -cf sudo
complete -cf man
# https://wiki.archlinux.org/index.php/Bash#Auto_.22cd.22_when_entering_just_a_path
shopt -s autocd
# Only load Liquid Prompt in interactive shells, not from a script or from scp
[[ $- = *i* ]] && source ~/.liquidprompt/liquidprompt
alias ls='ls -lsh --color=always --group-directories-first --time-style=+"%d.%m.%Y %H:%M"'
alias la='ls -lsha --color=always --group-directories-first --time-style=+"%d.%m.%Y %H:%M"'
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'''
alias grep='grep --color=tty -d skip'
alias cp="cp -i" # confirm before overwriting something
alias df="df -kTh" # human-readable sizes
alias free='free -m' # show sizes in MB
alias sys='sudo systemctl'
alias ggraph="git log --graph --abbrev-commit --decorate=no --format=format:'%C(bold yellow)%ai%C(reset)%C(yellow)(%ar)%C(reset)%C(auto)%+d%C(reset)%n''%C(dim white)%an%C(reset)%n''%C(bold white)%B%C(reset)%C(blue)%H%C(reset)%n' --all"
+9
View File
@@ -0,0 +1,9 @@
1 LP_COLOR_TIME="$BOLD_YELLOW"
2 LP_COLOR_HOST="$BOLD_CYAN"
3 LP_COLOR_SSH="$BOLD_CYAN"
4 LP_COLOR_USER_ROOT="$BOLD_RED"
5 LP_ENABLE_TIME=1
6 LP_ENABLE_BATT=0
7 LP_USER_ALWAYS=1
8 LP_PS1_POSTFIX="\n$ "
9 LP_ENABLE_JOBS=1
+4
View File
@@ -0,0 +1,4 @@
Description='A basic dhcp ethernet connection'
Interface=eth1
Connection=ethernet
IP=dhcp
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
ExecUpPost="/home/alarm/hehe-rover/rpi/sync.sh"
#ExecDownPre="systemctl stop crashplan.service; systemctl stop dropbox@<username>.service"
+16
View File
@@ -0,0 +1,16 @@
Description='A simple WPA encrypted wireless connection'
Interface=wlan0
Connection=wireless
Security=wpa
IP=dhcp
ESSID='hotspot'
# Prepend hexadecimal keys with \"
# If your key starts with ", write it as '""<key>"'
# See also: the section on special quoting rules in netctl.profile(5)
Key='pass2hotspot'
# Uncomment this if your ssid is hidden
#Hidden=yes
# Set a priority for automatic profile selection
#Priority=10
+7
View File
@@ -0,0 +1,7 @@
# wifi
# blacklist brcmfmac
# blacklist brcmutil
#bluetooth
blacklist btbcm
blacklist hci_uart
+8
View File
@@ -0,0 +1,8 @@
[Unit]
Description=kill wifi after 15 minutes
[Service]
ExecStart=/home/alarm/hehe-rover/rpi/autokillwifi.sh
[Install]
WantedBy=multi-user.target
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Pictures taken every n minutes
[Service]
ExecStart=/home/alarm/hehe-rover/rpi/camera.py
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Log GPS coordinates
[Service]
ExecStart=/home/alarm/hehe-rover/rpi/gps.py
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
+8
View File
@@ -0,0 +1,8 @@
[Unit]
Description=set up lteconnection huawei every 30min
[Service]
ExecStart=/home/alarm/hehe-rover/rpi/letconnect.sh
[Install]
WantedBy=multi-user.target
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=update hehe-rover every 6 hours
[Service]
ExecStart=/home/alarm/hehe-rover/rpi/update.sh
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
+1
View File
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJdyVlHLWE78I/24wscML7gxb1OuZSmkZY2j84jk9QkO1CqjzvX9NF+fkbeAqFs8cERkrQ2W8W4KZqNpVbMKxGVVnnUmhJV93eS5wOFyjvygZsIalovJbn867usJKgYRGNhKYyihC/iUR2E6BqTr1Q8rrjUmOItgZNS7iZfRbTq/Bb2M0DZJz2J7DojJli3bkGWhpqkSTu7KH3D10Z9HanpOHKJqZApx5u+PQrmILWtqVoGziXP+UNsCtMoF/U/6KSyKRIUsIlRD6wXR54Xm1r72WnuuPADYwJ1DYpmmkSvbYCVfR7xGrs9x6Bc+hUBaNL8YN74T2W6SCF/wRPWA6x bachir@g-u-i.me-2016-02-03
+4
View File
@@ -0,0 +1,4 @@
Host guinet
HostName 178.32.34.43
User hehe
IdentityFile ~/.ssh/id_rsa
+1
View File
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3k5L87bf1eHjHUedPdEKqpC4FhVdgkbj3de56Or01Ht+lyAPE+JYO8C3egkQivSCYTX2IE6dW3pgiydmImaOzS+ka0YsMkFZVUbheCPdvRZ79RcU5x41dl90KefG3HeKn2ZoxantW4EI9OdqCdt9bfdA3qn0r4b6abRVfQ74waxcMFNQ0Gd2nNxlfYVAC7gPfuQKDYF1WyQE24qviQAS+XkuBmNNoCi0SK5tM+Qhzj7OCmy0Kyw6dMUiCrU9lioRTutbXAVJjLPMSdiS2886rJsAtC8ba6Xch/rB/vtR9oxToOD2j/Jr51KwKe+CmGMxeNkAG4J8ScnWVknsIQbPh alarm@hehe-rail-rover
+1
View File
@@ -0,0 +1 @@
178.32.34.43 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl5sEUDjROwpbJurLMFO+ia6N8ilcrEanCKMLOWEAZN5LfH1D6Q00eLUmJdU8Qq2CGYMO63WWrlON90pH/z0lLib0FVv+M058lb0phQ4WG56chyRV6wgagJjw5UN5dpQVmDFi0ZQi51wDYGCbRW5Ed2zYmQEpnIMDVpxanZYGPRfEEpMVVqcYiEiUdDP+EkQY+t5mBfuAmR1AFLovO1HzWYruURzKg2ibEDFU7BA7boOyPZwZtqcCKuZR7rFuBllHsqp9uGHiMijTDD96B/DXwYZayssevgP0PhC+1abZJiG35tAiqCtKnY4bjDwyTm/s2sjUzYV2TikuaFbEi7KHJ
+276
View File
@@ -0,0 +1,276 @@
" Vim color file
"
" Author: Tomas Restrepo <tomas@winterdom.com>
" https://github.com/tomasr/molokai
"
" Note: Based on the Monokai theme for TextMate
" by Wimer Hazenberg and its darker variant
" by Hamish Stuart Macpherson
"
hi clear
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name="molokai"
if exists("g:molokai_original")
let s:molokai_original = g:molokai_original
else
let s:molokai_original = 0
endif
hi Boolean guifg=#AE81FF
hi Character guifg=#E6DB74
hi Number guifg=#AE81FF
hi String guifg=#E6DB74
hi Conditional guifg=#F92672 gui=bold
hi Constant guifg=#AE81FF gui=bold
hi Cursor guifg=#000000 guibg=#F8F8F0
hi iCursor guifg=#000000 guibg=#F8F8F0
hi Debug guifg=#BCA3A3 gui=bold
hi Define guifg=#66D9EF
hi Delimiter guifg=#8F8F8F
hi DiffAdd guibg=#13354A
hi DiffChange guifg=#89807D guibg=#4C4745
hi DiffDelete guifg=#960050 guibg=#1E0010
hi DiffText guibg=#4C4745 gui=italic,bold
hi Directory guifg=#A6E22E gui=bold
hi Error guifg=#E6DB74 guibg=#1E0010
hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold
hi Exception guifg=#A6E22E gui=bold
hi Float guifg=#AE81FF
hi FoldColumn guifg=#465457 guibg=#000000
hi Folded guifg=#465457 guibg=#000000
hi Function guifg=#A6E22E
hi Identifier guifg=#FD971F
hi Ignore guifg=#808080 guibg=bg
hi IncSearch guifg=#C4BE89 guibg=#000000
hi Keyword guifg=#F92672 gui=bold
hi Label guifg=#E6DB74 gui=none
hi Macro guifg=#C4BE89 gui=italic
hi SpecialKey guifg=#66D9EF gui=italic
hi MatchParen guifg=#000000 guibg=#FD971F gui=bold
hi ModeMsg guifg=#E6DB74
hi MoreMsg guifg=#E6DB74
hi Operator guifg=#F92672
" complete menu
hi Pmenu guifg=#66D9EF guibg=#000000
hi PmenuSel guibg=#808080
hi PmenuSbar guibg=#080808
hi PmenuThumb guifg=#66D9EF
hi PreCondit guifg=#A6E22E gui=bold
hi PreProc guifg=#A6E22E
hi Question guifg=#66D9EF
hi Repeat guifg=#F92672 gui=bold
hi Search guifg=#000000 guibg=#FFE792
" marks
hi SignColumn guifg=#A6E22E guibg=#232526
hi SpecialChar guifg=#F92672 gui=bold
hi SpecialComment guifg=#7E8E91 gui=bold
hi Special guifg=#66D9EF guibg=bg gui=italic
if has("spell")
hi SpellBad guisp=#FF0000 gui=undercurl
hi SpellCap guisp=#7070F0 gui=undercurl
hi SpellLocal guisp=#70F0F0 gui=undercurl
hi SpellRare guisp=#FFFFFF gui=undercurl
endif
hi Statement guifg=#F92672 gui=bold
hi StatusLine guifg=#455354 guibg=fg
hi StatusLineNC guifg=#808080 guibg=#080808
hi StorageClass guifg=#FD971F gui=italic
hi Structure guifg=#66D9EF
hi Tag guifg=#F92672 gui=italic
hi Title guifg=#ef5939
hi Todo guifg=#FFFFFF guibg=bg gui=bold
hi Typedef guifg=#66D9EF
hi Type guifg=#66D9EF gui=none
hi Underlined guifg=#808080 gui=underline
hi VertSplit guifg=#808080 guibg=#080808 gui=bold
hi VisualNOS guibg=#403D3D
hi Visual guibg=#403D3D
hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold
hi WildMenu guifg=#66D9EF guibg=#000000
hi TabLineFill guifg=#1B1D1E guibg=#1B1D1E
hi TabLine guibg=#1B1D1E guifg=#808080 gui=none
if s:molokai_original == 1
hi Normal guifg=#F8F8F2 guibg=#272822
hi Comment guifg=#75715E
hi CursorLine guibg=#3E3D32
hi CursorLineNr guifg=#FD971F gui=none
hi CursorColumn guibg=#3E3D32
hi ColorColumn guibg=#3B3A32
hi LineNr guifg=#BCBCBC guibg=#3B3A32
hi NonText guifg=#75715E
hi SpecialKey guifg=#75715E
else
hi Normal guifg=#F8F8F2 guibg=#1B1D1E
hi Comment guifg=#7E8E91
hi CursorLine guibg=#293739
hi CursorLineNr guifg=#FD971F gui=none
hi CursorColumn guibg=#293739
hi ColorColumn guibg=#232526
hi LineNr guifg=#465457 guibg=#232526
hi NonText guifg=#465457
hi SpecialKey guifg=#465457
end
"
" Support for 256-color terminal
"
if &t_Co > 255
if s:molokai_original == 1
hi Normal ctermbg=234
hi CursorLine ctermbg=235 cterm=none
hi CursorLineNr ctermfg=208 cterm=none
else
hi Normal ctermfg=252 ctermbg=233
hi CursorLine ctermbg=234 cterm=none
hi CursorLineNr ctermfg=208 cterm=none
endif
hi Boolean ctermfg=135
hi Character ctermfg=144
hi Number ctermfg=135
hi String ctermfg=144
hi Conditional ctermfg=161 cterm=bold
hi Constant ctermfg=135 cterm=bold
hi Cursor ctermfg=16 ctermbg=253
hi Debug ctermfg=225 cterm=bold
hi Define ctermfg=81
hi Delimiter ctermfg=241
hi DiffAdd ctermbg=24
hi DiffChange ctermfg=181 ctermbg=239
hi DiffDelete ctermfg=162 ctermbg=53
hi DiffText ctermbg=102 cterm=bold
hi Directory ctermfg=118 cterm=bold
hi Error ctermfg=219 ctermbg=89
hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold
hi Exception ctermfg=118 cterm=bold
hi Float ctermfg=135
hi FoldColumn ctermfg=67 ctermbg=16
hi Folded ctermfg=67 ctermbg=16
hi Function ctermfg=118
hi Identifier ctermfg=208 cterm=none
hi Ignore ctermfg=244 ctermbg=232
hi IncSearch ctermfg=193 ctermbg=16
hi keyword ctermfg=161 cterm=bold
hi Label ctermfg=229 cterm=none
hi Macro ctermfg=193
hi SpecialKey ctermfg=81
hi MatchParen ctermfg=233 ctermbg=208 cterm=bold
hi ModeMsg ctermfg=229
hi MoreMsg ctermfg=229
hi Operator ctermfg=161
" complete menu
hi Pmenu ctermfg=81 ctermbg=16
hi PmenuSel ctermfg=255 ctermbg=242
hi PmenuSbar ctermbg=232
hi PmenuThumb ctermfg=81
hi PreCondit ctermfg=118 cterm=bold
hi PreProc ctermfg=118
hi Question ctermfg=81
hi Repeat ctermfg=161 cterm=bold
hi Search ctermfg=0 ctermbg=222 cterm=NONE
" marks column
hi SignColumn ctermfg=118 ctermbg=235
hi SpecialChar ctermfg=161 cterm=bold
hi SpecialComment ctermfg=245 cterm=bold
hi Special ctermfg=81
if has("spell")
hi SpellBad ctermbg=52
hi SpellCap ctermbg=17
hi SpellLocal ctermbg=17
hi SpellRare ctermfg=none ctermbg=none cterm=reverse
endif
hi Statement ctermfg=161 cterm=bold
hi StatusLine ctermfg=238 ctermbg=253
hi StatusLineNC ctermfg=244 ctermbg=232
hi StorageClass ctermfg=208
hi Structure ctermfg=81
hi Tag ctermfg=161
hi Title ctermfg=166
hi Todo ctermfg=231 ctermbg=232 cterm=bold
hi Typedef ctermfg=81
hi Type ctermfg=81 cterm=none
hi Underlined ctermfg=244 cterm=underline
hi VertSplit ctermfg=244 ctermbg=232 cterm=bold
hi VisualNOS ctermbg=238
hi Visual ctermbg=235
hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold
hi WildMenu ctermfg=81 ctermbg=16
hi Comment ctermfg=59
hi CursorColumn ctermbg=236
hi ColorColumn ctermbg=236
hi LineNr ctermfg=250 ctermbg=236
hi NonText ctermfg=59
hi SpecialKey ctermfg=59
if exists("g:rehash256") && g:rehash256 == 1
hi Normal ctermfg=252 ctermbg=234
hi CursorLine ctermbg=236 cterm=none
hi CursorLineNr ctermfg=208 cterm=none
hi Boolean ctermfg=141
hi Character ctermfg=222
hi Number ctermfg=141
hi String ctermfg=222
hi Conditional ctermfg=197 cterm=bold
hi Constant ctermfg=141 cterm=bold
hi DiffDelete ctermfg=125 ctermbg=233
hi Directory ctermfg=154 cterm=bold
hi Error ctermfg=222 ctermbg=233
hi Exception ctermfg=154 cterm=bold
hi Float ctermfg=141
hi Function ctermfg=154
hi Identifier ctermfg=208
hi Keyword ctermfg=197 cterm=bold
hi Operator ctermfg=197
hi PreCondit ctermfg=154 cterm=bold
hi PreProc ctermfg=154
hi Repeat ctermfg=197 cterm=bold
hi Statement ctermfg=197 cterm=bold
hi Tag ctermfg=197
hi Title ctermfg=203
hi Visual ctermbg=238
hi Comment ctermfg=244
hi LineNr ctermfg=239 ctermbg=235
hi NonText ctermfg=239
hi SpecialKey ctermfg=239
endif
end
" Must be at the end, because of ctermbg=234 bug.
" https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
set background=dark
+1
View File
@@ -0,0 +1 @@
*.swp
+17
View File
@@ -0,0 +1,17 @@
filetype plugin on
set encoding=utf-8
set directory=~/.vim/swp
" last known cursor position
" autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
" remove trailing whitespace
autocmd BufWritePre * :%s/\s\+$//e
syntax on
set t_co=256
let g:molokai_termcolors=256
colorscheme molokai
set number
+49
View File
@@ -0,0 +1,49 @@
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = yes
Modem Type = Analog Modem
ISDN = 1
;Phone = *99#
Phone = DT*99#
;Phone = *99#
Username = orange
Password = orange
Modem = /dev/ttyS0
;Dial Command = ATDT
Dial Command = ISDN
;Dial Command = ATD
Baud = 2400
;[Dialer pin]
;Init3 = AT+CPIN=1828
;Init3 = AT+CNMI=?
;+CNMI: (0-2),(0-3),(0-3),(0-2),(0-1)
[Dialer orange]
Init2 = ATZ
Init3 = ATQ0 V1 &D2 &C1 S0=0 +IFC=2,2
Init5 = AT+CGDCONT=1,"IP","orange.fr"
ISDN = 1
Modem = /dev/ttyS0
Modem Type = Analog Modem
Baud = 2400
;APN ORANGE
;orange world
;orange world
;orange
;prxy : ...
;port : ...
;user : orange
;mdp : orange
;server : ...
;mcc 208
;mmc 01
;type auth : pap
;type apn BUN
;ipv4
;ipv4
;activer
;support : ...
+129
View File
@@ -0,0 +1,129 @@
#!/bin/sh
# author : bachir soussi chiadmi
# date : 10/06/2016
function install(){
_cwd="$(pwd)"
# candy
echo 'ILoveCandy (pacman)'
sudo sed -i.back 's/.*\[options\].*/&\nILoveCandy/' /etc/pacman.conf
sudo sed -i.back 's/^#Color$/Color/' /etc/pacman.conf
sudo sed -i.back 's/^#TotalDownload$/TotalDownload/' /etc/pacman.conf
# update systeme
sudo pacman -Syyu
# install basic packages
sudo pacman -S --needed --noconfirm vim rsync wget tmux
# configure vim
echo 'vim configuration'
sudo 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
sudo cp -r $_cwd/assets/vim /root/.vim
sudo cp $_cwd/assets/vimrc /root/.vimrc
# configure git
echo 'Git Completion'
sudo pacman -S --needed --noconfirm bash-completion
sudo mkdir /etc/bash_completion.d
sudo 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
# sudo 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'
sudo hostnamectl set-hostname pi-hotspot-4G
sudo sed -i 's/localhost$/&\tpi-hotspot-4G/' /etc/hosts
sudo sed -i 's/^hostname$/&\tpi-hotspot-4G/' /etc/dhcpcd.conf
# avahi
# echo "install avahi"
# sudo pacman -S --needed --noconfirm avahi nss-mdns
# echo "configure avahi"
# sudo systemctl enable avahi-daemon
# sudo systemctl start avahi-deamon
# sudo sed -i 's/hosts: files dns myhostname/hosts: files mdns_minimal [NOTFOUND=return] dns hehe-rail-rover/' /etc/nsswitch.conf
# disable bluetooth
sudo 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
sudo sh -c 'echo "max_usb_current=1" >> /boot/config.txt'
sudo 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"
sudo cp $_cwd/assets/netctl/huawei /etc/netctl/
sudo cp $_cwd/assets/netctl/synchook /etc/netctl/hooks/
echo "enable and start auto lte connection service"
sudo cp $_cwd/assets/services/lteconnect.service /etc/systemd/system/
sudo systemctl enable lteconnect.service
# HOTSPOT WIFI
echo "enable and start hotspot wifi netctl profile"
sudo cp $_cwd/assets/netctl/wifihotspot /etc/netctl/
sudo netctl enable wifihotspot
sudo netctl start wifihotspot
echo "enable and start auto kill wifi service"
sudo cp $_cwd/assets/services/autokillwifi.service /etc/systemd/system/
sudo systemctl enable autokillwifi.service
# dyndns
# yaourt -S --needed --noconfirm noip
# noip2 -C -Y
}
sudo timedatectl set-ntp true
sudo timedatectl 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-log
now=$(date +"%Y-%m-%d--%T")
logfile="/home/$USER/pi_hotspot-4G-$now.log"
touch $logfile
install | tee $logfile