diff --git a/README.md b/README.md index 77a55fa..db684bd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Bash Scripts collection +wget -O init_scripts.sh https://git.studi7.com/roger/bashscripts/raw/branch/master/init_scripts.sh && chmod +x init_scripts.sh && ./init_scripts.sh + ## gotifypush.sh Send markdown notifications to gotify channel throught curl diff --git a/init_scripts.sh b/init_scripts.sh index 599246e..bb08332 100644 --- a/init_scripts.sh +++ b/init_scripts.sh @@ -49,7 +49,7 @@ fi #echo $func_result #set +f -echo "/////////////////////////////////////" +echo "/////////////////////////////////////////" echo "Benvingut a l'instalador d'Scripts" echo -e "/////////////////////////////////////\n" diff --git a/remote_updater.sh b/remote_updater.sh old mode 100644 new mode 100755 index fa438b5..08f04cc --- a/remote_updater.sh +++ b/remote_updater.sh @@ -6,5 +6,72 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -cat .ssh/config | grep -E "^Host [^\*\*]" | sed "s/Host //" +readonly OFFSET_OPTIONS=3 +declare -a TARGETS +show_ssh_hosts () { + SSH_HOSTS_CONFIG_FILE="/root/.ssh/config" + + if [ -f $SSH_HOSTS_CONFIG_FILE ]; then + TARGETS=($(cat $SSH_HOSTS_CONFIG_FILE | grep -E "^Host [^\*\*]" | sed "s/Host //")) + # get length of an array + length=${#TARGETS[@]} + for (( j=0; j