102 lines
4.4 KiB
Bash
Executable File
102 lines
4.4 KiB
Bash
Executable File
#!/bin/bash
|
|
################################################################################
|
|
# Author: Fred (support@qo-op.com)
|
|
# Version: 0.1
|
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
|
################################################################################
|
|
MY_PATH="`dirname \"$0\"`" # relative
|
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
ME="${0##*/}"
|
|
|
|
echo "#############################################"
|
|
echo ">>>>>>>>>>> SYSTEM SETUP "
|
|
echo "#############################################"
|
|
#### SETUP JAKLIS ###############################################################
|
|
echo "=== SETUP jaklis"
|
|
cd ~/.zen/Astroport.ONE/tools/jaklis
|
|
sudo ./setup.sh
|
|
|
|
## XBIAN fail2ban ERROR correction ##
|
|
#[....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log
|
|
[[ "$USER" == "xbian" ]] && sudo sed -i "s/auth.log/faillog/g" /etc/fail2ban/paths-common.conf
|
|
|
|
### MODIFIYING /etc/sudoers ###
|
|
[[ "$USER" == "xbian" ]] && echo "xbian ALL=(ALL) NOPASSWD:ALL" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/astroport')
|
|
|
|
# PERSONNAL DEFCON LEVEL
|
|
# cp ~/.zen/Astroport.ONE/DEFCON ~/.zen/
|
|
|
|
if [[ "$USER" == "xbian" ]]
|
|
then
|
|
echo "enabling ipfs initV service autostart"
|
|
cd /etc/rc2.d && sudo ln -s ../init.d/ipfs S02ipfs
|
|
cd /etc/rc3.d && sudo ln -s ../init.d/ipfs S02ipfs
|
|
cd /etc/rc4.d && sudo ln -s ../init.d/ipfs S02ipfs
|
|
cd /etc/rc5.d && sudo ln -s ../init.d/ipfs S02ipfs
|
|
|
|
cd /etc/rc0.d && sudo ln -s ../init.d/ipfs K01ipfs
|
|
cd /etc/rc1.d && sudo ln -s ../init.d/ipfs K01ipfs
|
|
cd /etc/rc6.d && sudo ln -s ../init.d/ipfs K01ipfs
|
|
|
|
# Disable xbian-config auto launch
|
|
echo 0 > ~/.xbian-config-start
|
|
|
|
fi
|
|
|
|
########################################################################
|
|
# CREATE ~/astroport FILESYSTEM GATE
|
|
mkdir -p ~/Astroport/film
|
|
mkdir -p ~/Astroport/serie
|
|
mkdir -p ~/Astroport/anime
|
|
mkdir -p ~/Astroport/page
|
|
mkdir -p ~/Astroport/web
|
|
mkdir -p ~/Astroport/video
|
|
echo '${TYPE};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME' > ~/Astroport/ajouter_video.modele.txt
|
|
|
|
|
|
#######################################################################
|
|
|
|
echo "#############################################"
|
|
## https://darktrojan.github.io/openwith/webextension.html"
|
|
~/.zen/Astroport.ONE/open_with_linux.py install
|
|
|
|
echo "#############################################
|
|
# NOURRISSEZ VOTRE BLOB depuis Firefox !!
|
|
# https://addons.mozilla.org/firefox/addon/open-with
|
|
#############################################
|
|
## $HOME/.zen/Astroport.ONE/ajouter_media.sh ##
|
|
#############################################"
|
|
|
|
### ADD 20h12.sh CRON ###############
|
|
~/.zen/Astroport.ONE/tools/cron_VRFY.sh ON
|
|
|
|
########################################################################
|
|
# SUDO permissions
|
|
########################################################################
|
|
## USED FOR fail2ban-client (DEFCON)
|
|
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/fail2ban-client" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/fail2ban-client')
|
|
## USED FOR RAMDISK (video live streaming)
|
|
echo "$USER ALL=(ALL) NOPASSWD:/bin/mount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/mount')
|
|
echo "$USER ALL=(ALL) NOPASSWD:/bin/umount" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/umount')
|
|
## USED FOR SYSTEM UPGRADE
|
|
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt-get" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt-get')
|
|
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/apt" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/apt')
|
|
## USED FOR "systemctl restart ipfs"
|
|
echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
|
|
## USED FOR "sudo youtube-dl -U"
|
|
echo "$USER ALL=(ALL) NOPASSWD:/usr/local/bin/youtube-dl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/youtube-dl')
|
|
|
|
|
|
echo "#############################################"
|
|
echo "# ADDING <<<Astroport>>> DESKTOP SHORTCUT"
|
|
[[ -d ~/Bureau ]] && sed "s/_USER_/$USER/g" ~/.zen/Astroport.ONE/astroport.desktop > ~/Bureau/astroport.desktop && chmod +x ~/Bureau/astroport.desktop
|
|
[[ -d ~/Desktop ]] && sed "s/_USER_/$USER/g" ~/.zen/Astroport.ONE/astroport.desktop > ~/Desktop/astroport.desktop && chmod +x ~/Desktop/astroport.desktop
|
|
|
|
mkdir -p ~/.zen/tmp
|
|
|
|
|
|
echo "#############################################"
|
|
## INSTALL yt-dlp & SYMLINK youtube-dl
|
|
~/.zen/Astroport.ONE/youtube-dl.sh
|
|
|