Hotspot Wifi via ap-hotspot GUI

Rédigé par BeHuman 3 commentaires
Classé dans : Shell/Bash Mots clés : aucun

Salut,
Le but de ce script est de fournire une interface minimal pour l'application ap-hotspot. ap-hotspot permet de créer une point d'accès wifi à partir de votre ordinateur.

La version de base est en français. Cependant une âme charitable ma fait passer une version en anglais, que je me permet de partager à la suite de la source initiale.

 

 

#! /bin/bash

function gui() {
    action=`zenity \
        --list \
        --title="Hotspot Wifi" \
        --width="400" \
        --height="275" \
        --column="Action" --column=" Description" \
                    "debug"             "Démarrer avec les messages de débuggage" \
                    "start"             "Démarrer normalement" \
                    "stop"              "Stopper la hotspot" \
                    "restart"           "Redémarrer la hotspot" \
                    "config"            "Configurer la hotspot" \
                    "edit"              "Editer le fichier de configuration" \
                    "install"           "Installation"`
    if [[ $action == "install" ]]; then
        xterm -e "add-apt-repository ppa:nilarimogard/webupd8;apt-get update;apt-get -y --force-yes install ap-hotspot"
        gui
    elif [[ $action == "config" ]]; then
        xterm -e ap-hotspot configure
        gui
    elif [[ $action == "edit" ]]; then
        xterm -e nano /etc/hostapd-hotspot.conf
        gui
    elif [[ $action == "start" ]]; then
        xterm -e "ap-hotspot start; service dnsmasq restart"
        gui
    elif [[ $action == "debug" ]]; then
        xterm -e "ap-hotspot debug; service dnsmasq restart"
        gui
    elif [[ $action == "stop" ]]; then
        xterm -e "service dnsmasq stop; ap-hotspot stop"
        gui
    elif [[ $action == "restart" ]]; then
        xterm -e "service dnsmasq stop;ap-hotspot restart;service dnsmasq start"
        gui
    else
        exit 0
    fi
}

if [[ `whoami` != "root" ]]; then
    gksudo -m "Vous devez avoir les privilèges administrateur pour utiliser \"AP-HOTSPOT\"" "$0" &
    exit
fi

gui

Voilà le même script traduit en anglais et optimiser pour Ubuntu, Je remercie sincèrement Ahmed M. AbouZaid pour cette version wink

#! /bin/bash
#Zenity GUI for AP-Hotspot by Craft/CKDevelop.
#http://www.ckdevelop.org/index.php?article27/hotspot-wifi-via-ap-hotspot-gui
#Translated into English and Ubuntu-ized verstion by Ahmed M. AbouZaid. (1/11/2013)

function gui() {
    action=`zenity \
        --list \
        --title="AP-Hotspot Wifi" \
        --width="400" \
        --height="280" \
        --column="Action" --column=" Description" \
                    "debug"		"Start with debugging messages" \
                    "start"		"Start normally" \
                    "stop"		"Stops hotspot" \
                    "restart"		"Restart hotspot" \
                    "config"		"Configure hotspot" \
                    "edit"			"Edit the configuration file" \
                    "install"		"Install AP-Hotspot if not installed"`
    if [[ $action == "install" ]]; then
        xterm -e "add-apt-repository ppa:nilarimogard/webupd8; apt-get update; apt-get -y --force-yes install ap-hotspot"
        gui
    elif [[ $action == "config" ]]; then
        gnome-terminal -x bash -c "ap-hotspot configure"
        gui
    elif [[ $action == "edit" ]]; then
        gnome-terminal -x bash -c "gedit /etc/hostapd-hotspot.conf"
        gui
    elif [[ $action == "start" ]]; then
        gnome-terminal -x bash -c "ap-hotspot start; service dnsmasq restart"
        gui
    elif [[ $action == "debug" ]]; then
        gnome-terminal -x bash -c "ap-hotspot debug; service dnsmasq restart"
        gui
    elif [[ $action == "stop" ]]; then
       gnome-terminal -x bash -c"service dnsmasq stop; ap-hotspot stop"
        gui
    elif [[ $action == "restart" ]]; then
        gnome-terminal -x bash -c "service dnsmasq stop; ap-hotspot restart; service dnsmasq start"
        gui
    else
        exit 0
    fi
}
 
if [[ `whoami` != "root" ]]; then
    gksudo -m "You must have administrator privileges to use \"AP-HOTSPOT\"" "$0" &
    exit
fi
 
gui

 

3 commentaires

#1  - Ahmed M. AbouZaid a dit :

This translated into English and Ubuntu-ized verstion.
http://paste.ubuntu.com/6362654/

Merci pour ce script ^_^

Répondre
#2  - BeHuman a dit :

@Ahmed M. AbouZaid :
Merci pour cette contribution. Je la partage à la suite de la source initiale ++
english("Thank you for this contribution. I share as a result of the original source ++")

Répondre
#3  - Explorer a dit :

Merci beaucoup!!!
I looked for a simple way to create an ap for my android tablet und it worked without problems!

Répondre

Écrire un commentaire

Quelle est la troisième lettre du mot y18bqlj ?

Fil RSS des commentaires de cet article