diff --git a/README.md b/README.md index 9795d0e..ca80922 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # debian-gnome -configuration pour un bureau Gnome propre et efficace. -utilisé lors des Instalalis dispensés par Libre.re \ No newline at end of file +configuration pour un bureau Gnome propre et efficace. +utilisé lors des Instalalis dispensés par Libre.re + +## install + +`curl https://git.artcode.re/pvincent/debian-gnome/raw/master/src/main.bash | pkexec bash -s --` \ No newline at end of file diff --git a/src/main.bash b/src/main.bash new file mode 100755 index 0000000..7fb635b --- /dev/null +++ b/src/main.bash @@ -0,0 +1,61 @@ +#!/bin/bash + +## FUNCTIONS + +function runVoid(){ + local COMMAND="$@" + bash -c "${COMMAND}" >/dev/null 2>&1 + return $? +} + +## MAIN + +[ `id -u` -eq 0 ] && echo 'normal user required' && exit -1 + +ALLOWED_USERS=$(id -un) #CUSTOMIZE if needed! + +## openssh-server +PGKNAME='openssh-server' +runVoid dpkg-query --status $PGKNAME +if [ $? -ne 0 ] ; then + set -e + pkexec apt install $PGKNAME + pkexec /opt/debian-bash/tools/append_or_replace "^#\?PermitRootLogin.*$" "PermitRootLogin no" /etc/ssh/sshd_config + pkexec /opt/debian-bash/tools/append_or_replace "^#\?PasswordAuthentication.*$" "PasswordAuthentication no" /etc/ssh/sshd_config + pkexec /opt/debian-bash/tools/append_or_replace "^#\?AllowUsers.*$" "AllowUsers $ALLOWED_USERS" /etc/ssh/sshd_config + pkexec systemctl restart sshd + set +e +else + echo "${PGKNAME} already installed!" +fi + +## firefox latest +if [[ ! /usr/local/bin/firefox -ef /opt/firefox/firefox ]];then + set -e + cd /tmp + wget `curl 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US' | cut -d '"' -f2` -O firefox-latest.tar.bz2 + pkexec mkdir /opt/firefox -p + pkexec chown $USER /opt/firefox + tar -xjf firefox-latest.tar.bz2 -C /opt + cat <