Merci Hardware probleme résolue [c'était bien ce que tu disais]
Je me pose une question sur cat <EOF>
vos cat <EOF> sont construit comme cela
# modification DNS
rm /etc/resolv.conf && touch /etc/resolv.conf
cat <<'EOF' > /etc/resolv.conf
nameserver 127.0.0.1
nameserver 208.67.220.220
nameserver 208.67.222.222
EOF
voyant comment cela pouvais me faire gagnier du temp j'ai voulus m'en préparer quelque un mais ... cela ne fonctionnne pas aussi bien que je le voudrait.
rm /etc/privoxy/config && touch /etc/privoxy/config
cat <<'EOF'> /etc/privoxy/config
user-manual /usr/share/doc/privoxy/user-manual
confdir /etc/privoxy
logdir /var/log/privoxy
actionsfile match-all.action # Actions that are applied to all sites and maybe$
actionsfile default.action # Main actions file
actionsfile user.action # User customizations
filterfile default.filter
filterfile user.filter # User customizations
logfile logfile
listen-address localhost:8118
toggle 1
enable-remote-toggle 0
enable-remote-http-toggle 0
enable-edit-actions 0
enforce-blocks 0
buffer-limit 4096
forward-socks4a / 127.0.0.1:9050 .
forwarded-connect-retries 0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 5
socket-timeout 300
EOF
et voici le code erreure
./petit-test-entre-amis-debug.sh : ligne 76: erreur de syntaxe près du symbole inattendu « /etc/privoxy/config »
./petit-test-entre-amis-debug.sh : ligne 76: `rm /etc/privoxy/config && touch /etc/privoxy/config'
je ne comprend pas pourquoi auriez vous une idée ?
je me permet de remettre mon script avec dernier changement
#!/bin/bash
#
# variables couleurs
CSI="\033["
CEND="${CSI}0m"
CRED="${CSI}1;31m"
CGREEN="${CSI}1;32m"
CYELLOW="${CSI}1;33m"
CBLUE="${CSI}1;34m"
LOG="/tmp/test0-0"
MSG="../\Attention et ouvre tes yeux\/.."
RG="$(printf '\e[0;31m')"
NT="$(printf '\e[0;m')"
VE="$(printf '\e[0;32m')"
trap "echo -e ''; echo -e '$RG [!]$NT Exiting ...'; echo -e ''; exit 0" INT
function f_menu {
echo; echo -n "script $0 starting at"; date
# contrôle droits utilisateur
if [ $(id -u) -ne 0 ]; then
echo ""
echo -e "${CRED} Ce script doit être exécuté en root.$CEND" 1>&2
echo ""
exit 1
fi
clear
#log
#LOG="/tmp/test0-0"
# message d'accueil
echo ""
echo -e "${CBLUE} Bienvenue dans cette installation cool$CEND"
echo ""
# logo
echo -e "${CBLUE}
[] []
<___-___>
-
$CEND"
echo ""
echo -e "${CYELLOW} Plusieur choix vons vous étre proposer,$CEND"
echo -e "${CYELLOW} A vous de voir les quels choisir.$CEND"
echo ""
#clear
echo
echo "$VE Choisissez une option [1-15]$NT"
echo ""
echo " 1 $VE:$NT install privoxy & tor"
echo " 2 $VE:$NT portsentry"
echo " 3 $VE:$NT rkhunter"
echo " 4 $VE:$NT import bashrc alias etc"
echo " 5 $VE:$NT install seedbox "
echo " 6 $VE:$NT worpresse"
echo " 7 $VE:$NT migration ver debian 8 si pas fais"
echo " 8 $VE:$NT vpn"
echo " 9 $VE:$NT cloud"
echo " 10 $VE:$NT mumble teamspeak"
echo " 11 $VE:$NT straming torrent"
echo " 12 $VE:$NT minecraft serv"
echo " 13 $VE:$NT cakebox"
echo " 14 $VE:$NT Reboot"
echo " 15 $VE:$NT Quitter"
echo ""
read -p "$VE Veuillez choisir :$NT " optionmenu
case $optionmenu in
1)echo "install privoxy & tor"
aptitude install privoxy tor -y; f_menu;;
#add via EOF ou possibiliter de scp via un user et les conf
rm /etc/privoxy/config && touch /etc/privoxy/config
cat <<'EOF'> /etc/privoxy/config
user-manual /usr/share/doc/privoxy/user-manual
confdir /etc/privoxy
logdir /var/log/privoxy
actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
actionsfile default.action # Main actions file
actionsfile user.action # User customizations
filterfile default.filter
filterfile user.filter # User customizations
logfile logfile
listen-address localhost:8118
toggle 1
enable-remote-toggle 0
enable-remote-http-toggle 0
enable-edit-actions 0
enforce-blocks 0
buffer-limit 4096
forward-socks4a / 127.0.0.1:9050 .
forwarded-connect-retries 0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 5
socket-timeout 300
EOF
/etc/init.d/tor restart && /etc/init.d/privoxy restart
2)echo "portsentry"
aptitude install portsentry -y ; f_menu;;
#add avec EOF ou possibiliter de scp via un user et les conf [attention deux fichier a change]
#######################
# Port Configurations #
#######################
# Use these if you just want to be aware:
#TCP_PORTS="1,11,15,79,111,119,143,540,635,1080,1524,2000,5742,6667,12345,12346,20034,27665,31337,32771,32772,32773,32774,40421,49724,54320"
#UDP_PORTS="1,7,9,69,161,162,513,635,640,641,700,37444,34555,31335,32770,32771,32772,32773,32774,31337,54321"
###########################################
# Advanced Stealth Scan Detection Options #
###########################################
#ADVANCED_PORTS_TCP="1024"
#ADVANCED_PORTS_UDP="1024"
#ADVANCED_EXCLUDE_TCP="113,139"
#ADVANCED_EXCLUDE_UDP="520,138,137,67"
######################
# Configuration Files#
######################
#IGNORE_FILE="/etc/portsentry/portsentry.ignore"
#HISTORY_FILE="/var/lib/portsentry/portsentry.history"
#BLOCKED_FILE="/var/lib/portsentry/portsentry.blocked"
##############################
# Misc. Configuration Options#
##############################
#RESOLVE_HOST = "0"
##################
# Ignore Options #
##################
# 2 = Run external command only (KILL_RUN_CMD)
# 1 = ori donc deux en test
#BLOCK_UDP="2"
#BLOCK_TCP="2"
###################
# Dropping Routes:#
###################
#KILL_ROUTE="/sbin/route add -host $TARGET$ reject"
#KILL_ROUTE="/sbin/route add -host $TARGET$ reject"
###############
# TCP Wrappers#
###############
#KILL_HOSTS_DENY="ALL: $TARGET$ : DENY"
###################
# External Command#
###################
#KILL_RUN_CMD="/sbin/iptables -I INPUT -s $TARGET$ -j DROP && /sbin/iptables -I INPUT -s $TARGET$ -m limit --limit 3/minute --limit-burst 5 -j LOG --log-level debug --log-prefix 'Portsentry: dropping: '"
#####################
# Scan trigger value#
#####################
#SCAN_TRIGGER="0"
######################
# Port Banner Section#
######################
#
#-------------------deusieme fichier a add via EOF
# ce localise /etc/default/portsentry
#TCP_MODE="atcp"
#UDP_MODE="audp"
3)echo "rkhunter"
aptitude install rkhunter -y ;f_menu;;
#a add via EOF ou ou possibiliter de scp via un user et les conf [arbo /etc/rkhunter.conf]
#TMPDIR=/var/lib/rkhunter/tmp
#DBDIR=/var/lib/rkhunter/db
#SCRIPTDIR=/usr/share/rkhunter/scripts
#LANGUAGE=fr
#UPDATE_LANG="fr"
#LOGFILE=/var/log/rkhunter.log
#COLOR_SET2=1
#AUTO_X_DETECT=1
#ALLOW_SSH_ROOT_USER=no
#ENABLE_TESTS=ALL
#DISABLE_TESTS=suspscan hidden_procs deleted_files packet_cap_apps apps
#SCRIPTWHITELIST=/bin/egrep
#SCRIPTWHITELIST=/bin/fgrep
#SCRIPTWHITELIST=/bin/which
#SCRIPTWHITELIST=/usr/bin/groups
#SCRIPTWHITELIST=/usr/bin/ldd
#SCRIPTWHITELIST=/usr/bin/lwp-request
#SCRIPTWHITELIST=/usr/sbin/adduser
#ALLOWHIDDENDIR="/dev/.udev"
#ALLOWHIDDENFILE="/dev/.blkid.tab"
#ALLOWHIDDENFILE="/dev/.blkid.tab.old"
#ALLOWHIDDENFILE="/dev/.initramfs"
#ALLOWDEVFILE="/dev/.udev/rules.d/root.rules"
4)echo "bashrc & alias"
++ ; f_menu;;
#export LS_OPTIONS='--color=auto'
#eval "`dircolors`"
#alias ls='ls $LS_OPTIONS'
#alias ll='ls $LS_OPTIONS -l'
#alias saidar='saidar -c -d 1'
#alias df='df -h'
#alias ls='ls -alsh'
#alias ls-disk='ls -l /dev/disk/by-uuid'
#alias ifstat='ifstat -i eth0 -t -b 1'
##alias apt-get='torify apt-get'
##alias aptitude='torify aptitude'
##alias apti-U_G='torify aptitude update && aptitude safe-upgrade'
##alias git-C='torify git clone'
##alias µ£='| ccze'
## tous les log en ccze
##balise ps1
#export PS1="\[\e[00;37m\]\n\[\e[0m\]\[\e[01;34m\][\[\e[0m\]\[\e[00;37m\]\A\[\e[0m\]\[\e[01;34m\]]\[\e[0m\]\[\e[01;32m\][\[\e[0m\]\[\e[01;37m\]\h\[\e[0m\]\[\e[01;32m\]]\[\e[0m\]\[\e[01;34m\][\[\e[0m\]\[\e[00;37m\]\w\[\e[0m\]\[\e[01;34m\]]\[\e[0m\]\[\e[00;37m\]\n[\[\e[0m\]\[\e[01;31m\]\\$\[\e[0m\]\[\e[00;37m\]] \u \[\e[0m\]\[\e[01;32m\]-\[\e[0m\]\[\e[01;33m\]>\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"
##auto-complementation
#if [ -f /etc/bash_completion ]; then
#. /etc/bash_completion
#fi
##gen pass
#genpasswd() {
# local l=$1
# [ "$l" == "" ] && l=16
# tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
#}
5)echo "seedbox"
+++ ; f_menu;;
# script en cour de pofinage
6)echo "wordpresse"
++++ ; f_menu;;
#instalation de wordpress
7)echo "7>8"
+++++ ; f_menu;;
#passer de debian wheezy a jessie
8)echo "vpn"
+++++ ; f_menu;;
#mise en place d'un vpn perso
9)echo "cloud"
++++++ ; f_menu;;
#mise en place de cozi
10)echo "mumble teamspeak"
++++++ ; f_menu;;
#au choix deux configuration prés remplis seront a disposition
11)echo "straming"
+++++++ ; f_menu;;
#instalation au choix
12)echo "minecraft"
++++++++ ; f_menu;;
#mise en place d'un serveur complet (save, backup, event, ender, etc..)
13)echo "cakebox ou hai5 ou les deux"
+++++++++ ;f_menu;;
#instalation de ces dis logs
14)echo "reboot"
shutdown -r now; exit 0;;
15)echo -e ""; exit 0;;
*)clear; echo -e "$RG"
nLetter=${#MSG};i=0; while [ "$i" -lt "$nLetter" ]; do sleep 0.05; echo -n "${MSG:$i:1}"; (( i += 1 )); done; sleep 1; echo -e "$NT"; echo -e ""
f_menu
esac
}
f_menu
#} 2>&1 | tee -a "$LOG"