etc files
This commit is contained in:
3
etcs/dnsmasq.conf
Normal file
3
etcs/dnsmasq.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
interface=wlan0
|
||||
dhcp-range=192.168.1.10,192.168.1.100,255.255.255.0,24h
|
||||
address=/terahz.site/192.168.1.1
|
||||
4
etcs/hostapd/default/avahi-daemon
Normal file
4
etcs/hostapd/default/avahi-daemon
Normal file
@@ -0,0 +1,4 @@
|
||||
# 1 = Try to detect unicast dns servers that serve .local and disable avahi in
|
||||
# that case, 0 = Don't try to detect .local unicast dns servers, can cause
|
||||
# troubles on misconfigured networks
|
||||
AVAHI_DAEMON_DETECT_LOCAL=1
|
||||
20
etcs/hostapd/default/bluetooth
Normal file
20
etcs/hostapd/default/bluetooth
Normal file
@@ -0,0 +1,20 @@
|
||||
# Defaults for bluez
|
||||
|
||||
# start bluetooth on boot?
|
||||
# compatibility note: if this variable is _not_ found bluetooth will start
|
||||
BLUETOOTH_ENABLED=1
|
||||
|
||||
# This setting used to switch HID devices (e.g mouse/keyboad) to HCI mode, that
|
||||
# is you will have bluetooth functionality from your dongle instead of only
|
||||
# HID. This is accomplished for supported devices by udev in
|
||||
# /lib/udev/rules.d/62-bluez-hid2hci.rules by invoking hid2hci with correct
|
||||
# parameters.
|
||||
# See /usr/share/doc/bluez/NEWS.Debian.gz for further information.
|
||||
|
||||
# Older daemons like pand dund and hidd can be found in bluez-compat package as
|
||||
# they are deprecated and provided for backward compatibility only.
|
||||
|
||||
# Note that not every bluetooth dongle is capable of switching back to HID mode,
|
||||
# see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355497
|
||||
HID2HCI_ENABLED=0
|
||||
HID2HCI_UNDO=0
|
||||
4
etcs/hostapd/default/bsdmainutils
Normal file
4
etcs/hostapd/default/bsdmainutils
Normal file
@@ -0,0 +1,4 @@
|
||||
# Uncomment the following line if you'd like all of your users'
|
||||
# ~/calendar files to be checked daily. Calendar will send them mail
|
||||
# to remind them of upcoming events. See calendar(1) for more details.
|
||||
#RUN_DAILY=true
|
||||
16
etcs/hostapd/default/console-setup
Normal file
16
etcs/hostapd/default/console-setup
Normal file
@@ -0,0 +1,16 @@
|
||||
# CONFIGURATION FILE FOR SETUPCON
|
||||
|
||||
# Consult the console-setup(5) manual page.
|
||||
|
||||
ACTIVE_CONSOLES="/dev/tty[1-6]"
|
||||
|
||||
CHARMAP="UTF-8"
|
||||
|
||||
CODESET="guess"
|
||||
FONTFACE=""
|
||||
FONTSIZE=""
|
||||
|
||||
VIDEOMODE=
|
||||
|
||||
# The following is an example how to use a braille font
|
||||
# FONT='lat9w-08.psf.gz brl-8x8.psf'
|
||||
11
etcs/hostapd/default/crda
Normal file
11
etcs/hostapd/default/crda
Normal file
@@ -0,0 +1,11 @@
|
||||
# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
|
||||
# the initial regulatory domain setting for IEEE 802.11 devices which operate
|
||||
# on this system.
|
||||
#
|
||||
# Governments assert the right to regulate usage of radio spectrum within
|
||||
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
|
||||
# country code suitable for your location or you may infringe on local
|
||||
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
|
||||
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.
|
||||
|
||||
REGDOMAIN=
|
||||
28
etcs/hostapd/default/cron
Normal file
28
etcs/hostapd/default/cron
Normal file
@@ -0,0 +1,28 @@
|
||||
# Cron configuration options
|
||||
|
||||
# Whether to read the system's default environment files (if present)
|
||||
# If set to "yes", cron will set a proper mail charset from the
|
||||
# locale information. If set to something other than 'yes', the default
|
||||
# charset 'C' (canonical name: ANSI_X3.4-1968) will be used.
|
||||
#
|
||||
# This has no effect on tasks running under cron; their environment can
|
||||
# only be changed via PAM or from within the crontab; see crontab(5).
|
||||
READ_ENV="yes"
|
||||
|
||||
# Extra options for cron, see cron(8)
|
||||
#
|
||||
# For example, to enable LSB name support in /etc/cron.d/, use
|
||||
# EXTRA_OPTS='-l'
|
||||
#
|
||||
# Or, to log standard messages, plus jobs with exit status != 0:
|
||||
# EXTRA_OPTS='-L 5'
|
||||
#
|
||||
# For quick reference, the currently available log levels are:
|
||||
# 0 no logging (errors are logged regardless)
|
||||
# 1 log start of jobs
|
||||
# 2 log end of jobs
|
||||
# 4 log jobs with exit status != 0
|
||||
# 8 log the process identifier of child process (in all logs)
|
||||
#
|
||||
#EXTRA_OPTS=""
|
||||
|
||||
7
etcs/hostapd/default/dbus
Normal file
7
etcs/hostapd/default/dbus
Normal file
@@ -0,0 +1,7 @@
|
||||
# This is a configuration file for /etc/init.d/dbus; it allows you to
|
||||
# perform common modifications to the behavior of the dbus daemon
|
||||
# startup without editing the init script (and thus getting prompted
|
||||
# by dpkg on upgrades). We all love dpkg prompts.
|
||||
|
||||
# Parameters to pass to dbus.
|
||||
PARAMS=""
|
||||
33
etcs/hostapd/default/dnsmasq
Normal file
33
etcs/hostapd/default/dnsmasq
Normal file
@@ -0,0 +1,33 @@
|
||||
# This file has five functions:
|
||||
# 1) to completely disable starting dnsmasq,
|
||||
# 2) to set DOMAIN_SUFFIX by running `dnsdomainname`
|
||||
# 3) to select an alternative config file
|
||||
# by setting DNSMASQ_OPTS to --conf-file=<file>
|
||||
# 4) to tell dnsmasq to read the files in /etc/dnsmasq.d for
|
||||
# more configuration variables.
|
||||
# 5) to stop the resolvconf package from controlling dnsmasq's
|
||||
# idea of which upstream nameservers to use.
|
||||
# For upgraders from very old versions, all the shell variables set
|
||||
# here in previous versions are still honored by the init script
|
||||
# so if you just keep your old version of this file nothing will break.
|
||||
|
||||
#DOMAIN_SUFFIX=`dnsdomainname`
|
||||
#DNSMASQ_OPTS="--conf-file=/etc/dnsmasq.alt"
|
||||
|
||||
# Whether or not to run the dnsmasq daemon; set to 0 to disable.
|
||||
ENABLED=1
|
||||
|
||||
# By default search this drop directory for configuration options.
|
||||
# Libvirt leaves a file here to make the system dnsmasq play nice.
|
||||
# Comment out this line if you don't want this. The dpkg-* are file
|
||||
# endings which cause dnsmasq to skip that file. This avoids pulling
|
||||
# in backups made by dpkg.
|
||||
CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new
|
||||
|
||||
# If the resolvconf package is installed, dnsmasq will use its output
|
||||
# rather than the contents of /etc/resolv.conf to find upstream
|
||||
# nameservers. Uncommenting this line inhibits this behaviour.
|
||||
# Note that including a "resolv-file=<filename>" line in
|
||||
# /etc/dnsmasq.conf is not enough to override resolvconf if it is
|
||||
# installed: the line below must be uncommented.
|
||||
IGNORE_RESOLVCONF=yes
|
||||
2
etcs/hostapd/default/fake-hwclock
Normal file
2
etcs/hostapd/default/fake-hwclock
Normal file
@@ -0,0 +1,2 @@
|
||||
# Uncomment to set clock even if saved value appears to be in the past
|
||||
#FORCE=force
|
||||
20
etcs/hostapd/default/hostapd
Normal file
20
etcs/hostapd/default/hostapd
Normal file
@@ -0,0 +1,20 @@
|
||||
# Defaults for hostapd initscript
|
||||
#
|
||||
# See /usr/share/doc/hostapd/README.Debian for information about alternative
|
||||
# methods of managing hostapd.
|
||||
#
|
||||
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
|
||||
# file and hostapd will be started during system boot. An example configuration
|
||||
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
|
||||
#
|
||||
DAEMON_CONF="/etc/hostapd/hostapd.conf"
|
||||
|
||||
# Additional daemon options to be appended to hostapd command:-
|
||||
# -d show more debug messages (-dd for even more)
|
||||
# -K include key data in debug messages
|
||||
# -t include timestamps in some debug messages
|
||||
#
|
||||
# Note that -B (daemon mode) and -P (pidfile) options are automatically
|
||||
# configured by the init.d script and must not be added to DAEMON_OPTS.
|
||||
#
|
||||
#DAEMON_OPTS=""
|
||||
19
etcs/hostapd/default/hwclock
Normal file
19
etcs/hostapd/default/hwclock
Normal file
@@ -0,0 +1,19 @@
|
||||
# Defaults for the hwclock init script. See hwclock(5) and hwclock(8).
|
||||
|
||||
# This is used to specify that the hardware clock incapable of storing
|
||||
# years outside the range of 1994-1999. Set to yes if the hardware is
|
||||
# broken or no if working correctly.
|
||||
#BADYEAR=no
|
||||
|
||||
# Set this to yes if it is possible to access the hardware clock,
|
||||
# or no if it is not.
|
||||
#HWCLOCKACCESS=yes
|
||||
|
||||
# Set this to any options you might need to give to hwclock, such
|
||||
# as machine hardware clock type for Alphas.
|
||||
#HWCLOCKPARS=
|
||||
|
||||
# Set this to the hardware clock device you want to use, it should
|
||||
# probably match the CONFIG_RTC_HCTOSYS_DEVICE kernel config option.
|
||||
#HCTOSYS_DEVICE=rtc0
|
||||
|
||||
10
etcs/hostapd/default/keyboard
Normal file
10
etcs/hostapd/default/keyboard
Normal file
@@ -0,0 +1,10 @@
|
||||
# KEYBOARD CONFIGURATION FILE
|
||||
|
||||
# Consult the keyboard(5) manual page.
|
||||
|
||||
XKBMODEL="pc105"
|
||||
XKBLAYOUT="gb"
|
||||
XKBVARIANT=""
|
||||
XKBOPTIONS=""
|
||||
|
||||
BACKSPACE="guess"
|
||||
2
etcs/hostapd/default/locale
Normal file
2
etcs/hostapd/default/locale
Normal file
@@ -0,0 +1,2 @@
|
||||
# File generated by update-locale
|
||||
LANG=en_GB.UTF-8
|
||||
11
etcs/hostapd/default/networking
Normal file
11
etcs/hostapd/default/networking
Normal file
@@ -0,0 +1,11 @@
|
||||
# Configuration for networking init script being run during
|
||||
# the boot sequence
|
||||
|
||||
# Set to 'no' to skip interfaces configuration on boot
|
||||
#CONFIGURE_INTERFACES=yes
|
||||
|
||||
# Don't configure these interfaces. Shell wildcards supported/
|
||||
#EXCLUDE_INTERFACES=
|
||||
|
||||
# Set to 'yes' to enable additional verbosity
|
||||
#VERBOSE=no
|
||||
19
etcs/hostapd/default/nfs-common
Normal file
19
etcs/hostapd/default/nfs-common
Normal file
@@ -0,0 +1,19 @@
|
||||
# If you do not set values for the NEED_ options, they will be attempted
|
||||
# autodetected; this should be sufficient for most people. Valid alternatives
|
||||
# for the NEED_ options are "yes" and "no".
|
||||
|
||||
# Do you want to start the statd daemon? It is not needed for NFSv4.
|
||||
NEED_STATD=
|
||||
|
||||
# Options for rpc.statd.
|
||||
# Should rpc.statd listen on a specific port? This is especially useful
|
||||
# when you have a port-based firewall. To use a fixed port, set this
|
||||
# this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
|
||||
# For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
|
||||
STATDOPTS=
|
||||
|
||||
# Do you want to start the idmapd daemon? It is only needed for NFSv4.
|
||||
NEED_IDMAPD=
|
||||
|
||||
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
|
||||
NEED_GSSD=
|
||||
37
etcs/hostapd/default/nss
Normal file
37
etcs/hostapd/default/nss
Normal file
@@ -0,0 +1,37 @@
|
||||
# /etc/default/nss
|
||||
# This file can theoretically contain a bunch of customization variables
|
||||
# for Name Service Switch in the GNU C library. For now there are only
|
||||
# four variables:
|
||||
#
|
||||
# NETID_AUTHORITATIVE
|
||||
# If set to TRUE, the initgroups() function will accept the information
|
||||
# from the netid.byname NIS map as authoritative. This can speed up the
|
||||
# function significantly if the group.byname map is large. The content
|
||||
# of the netid.byname map is used AS IS. The system administrator has
|
||||
# to make sure it is correctly generated.
|
||||
#NETID_AUTHORITATIVE=TRUE
|
||||
#
|
||||
# SERVICES_AUTHORITATIVE
|
||||
# If set to TRUE, the getservbyname{,_r}() function will assume
|
||||
# services.byservicename NIS map exists and is authoritative, particularly
|
||||
# that it contains both keys with /proto and without /proto for both
|
||||
# primary service names and service aliases. The system administrator
|
||||
# has to make sure it is correctly generated.
|
||||
#SERVICES_AUTHORITATIVE=TRUE
|
||||
#
|
||||
# SETENT_BATCH_READ
|
||||
# If set to TRUE, various setXXent() functions will read the entire
|
||||
# database at once and then hand out the requests one by one from
|
||||
# memory with every getXXent() call. Otherwise each getXXent() call
|
||||
# might result into a network communication with the server to get
|
||||
# the next entry.
|
||||
#SETENT_BATCH_READ=TRUE
|
||||
#
|
||||
# ADJUNCT_AS_SHADOW
|
||||
# If set to TRUE, the passwd routines in the NIS NSS module will not
|
||||
# use the passwd.adjunct.byname tables to fill in the password data
|
||||
# in the passwd structure. This is a security problem if the NIS
|
||||
# server cannot be trusted to send the passwd.adjuct table only to
|
||||
# privileged clients. Instead the passwd.adjunct.byname table is
|
||||
# used to synthesize the shadow.byname table if it does not exist.
|
||||
ADJUNCT_AS_SHADOW=TRUE
|
||||
11
etcs/hostapd/default/raspberrypi-kernel
Normal file
11
etcs/hostapd/default/raspberrypi-kernel
Normal file
@@ -0,0 +1,11 @@
|
||||
# Defaults for raspberrypi-kernel
|
||||
|
||||
# Uncomment the following line to enable generation of
|
||||
# /boot/initrd.img-KVER files (requires initramfs-tools)
|
||||
|
||||
#INITRD=Yes
|
||||
|
||||
# Uncomment the following line to enable generation of
|
||||
# /boot/initrd(7).img files (requires rpi-initramfs-tools)
|
||||
|
||||
#RPI_INITRD=Yes
|
||||
47
etcs/hostapd/default/rsync
Normal file
47
etcs/hostapd/default/rsync
Normal file
@@ -0,0 +1,47 @@
|
||||
# defaults file for rsync daemon mode
|
||||
#
|
||||
# This file is only used for init.d based systems!
|
||||
# If this system uses systemd, you can specify options etc. for rsync
|
||||
# in daemon mode by copying /lib/systemd/system/rsync.service to
|
||||
# /etc/systemd/system/rsync.service and modifying the copy; add required
|
||||
# options to the ExecStart line.
|
||||
|
||||
# start rsync in daemon mode from init.d script?
|
||||
# only allowed values are "true", "false", and "inetd"
|
||||
# Use "inetd" if you want to start the rsyncd from inetd,
|
||||
# all this does is prevent the init.d script from printing a message
|
||||
# about not starting rsyncd (you still need to modify inetd's config yourself).
|
||||
RSYNC_ENABLE=false
|
||||
|
||||
# which file should be used as the configuration file for rsync.
|
||||
# This file is used instead of the default /etc/rsyncd.conf
|
||||
# Warning: This option has no effect if the daemon is accessed
|
||||
# using a remote shell. When using a different file for
|
||||
# rsync you might want to symlink /etc/rsyncd.conf to
|
||||
# that file.
|
||||
# RSYNC_CONFIG_FILE=
|
||||
|
||||
# what extra options to give rsync --daemon?
|
||||
# that excludes the --daemon; that's always done in the init.d script
|
||||
# Possibilities are:
|
||||
# --address=123.45.67.89 (bind to a specific IP address)
|
||||
# --port=8730 (bind to specified port; default 873)
|
||||
RSYNC_OPTS=''
|
||||
|
||||
# run rsyncd at a nice level?
|
||||
# the rsync daemon can impact performance due to much I/O and CPU usage,
|
||||
# so you may want to run it at a nicer priority than the default priority.
|
||||
# Allowed values are 0 - 19 inclusive; 10 is a reasonable value.
|
||||
RSYNC_NICE=''
|
||||
|
||||
# run rsyncd with ionice?
|
||||
# "ionice" does for IO load what "nice" does for CPU load.
|
||||
# As rsync is often used for backups which aren't all that time-critical,
|
||||
# reducing the rsync IO priority will benefit the rest of the system.
|
||||
# See the manpage for ionice for allowed options.
|
||||
# -c3 is recommended, this will run rsync IO at "idle" priority. Uncomment
|
||||
# the next line to activate this.
|
||||
# RSYNC_IONICE='-c3'
|
||||
|
||||
# Don't forget to create an appropriate config file,
|
||||
# else the daemon will not start.
|
||||
4
etcs/hostapd/default/rsyslog
Normal file
4
etcs/hostapd/default/rsyslog
Normal file
@@ -0,0 +1,4 @@
|
||||
# Options for rsyslogd
|
||||
# -x disables DNS lookups for remote messages
|
||||
# See rsyslogd(8) for more details
|
||||
RSYSLOGD_OPTIONS=""
|
||||
5
etcs/hostapd/default/ssh
Normal file
5
etcs/hostapd/default/ssh
Normal file
@@ -0,0 +1,5 @@
|
||||
# Default settings for openssh-server. This file is sourced by /bin/sh from
|
||||
# /etc/init.d/ssh.
|
||||
|
||||
# Options to pass to sshd
|
||||
SSHD_OPTS=
|
||||
22
etcs/hostapd/default/timidity
Normal file
22
etcs/hostapd/default/timidity
Normal file
@@ -0,0 +1,22 @@
|
||||
# Defaults for TiMidity++ scripts
|
||||
# sourced by /etc/init.d/timidity
|
||||
# installed at /etc/default/timidity by the maintainer scripts
|
||||
# $Id: timidity.default,v 1.3 2004/08/07 14:33:26 hmh Exp $
|
||||
|
||||
#
|
||||
# This is a POSIX shell fragment
|
||||
#
|
||||
|
||||
SERVER_HOME=/etc/timidity
|
||||
SERVER_USER=timidity
|
||||
SERVER_NAME="TiMidity++ MIDI sequencer service"
|
||||
SERVER_GROUP=timidity
|
||||
ADDGROUP=audio
|
||||
|
||||
# Enable MIDI sequencer (ALSA), if timidity-deamon is installed
|
||||
|
||||
# uncomment to override enabling triggered by availability of timidity-deamon
|
||||
# TIM_ALSASEQ=false
|
||||
|
||||
# Setting overrides (of /etc/timidity.conf) for the ALSA sequencer daemon
|
||||
TIM_ALSASEQPARAMS="-Os"
|
||||
17
etcs/hostapd/default/triggerhappy
Normal file
17
etcs/hostapd/default/triggerhappy
Normal file
@@ -0,0 +1,17 @@
|
||||
# Defaults for triggerhappy initscript
|
||||
# sourced by /etc/init.d/triggerhappy
|
||||
# installed at /etc/default/triggerhappy by the maintainer scripts
|
||||
|
||||
#
|
||||
# This is a POSIX shell fragment
|
||||
#
|
||||
|
||||
# Additional options that are passed to the Daemon.
|
||||
DAEMON_OPTS=""
|
||||
|
||||
# The Triggerhappy daemon (thd) drops its root privileges after
|
||||
# startup and becomes "nobody". If you want it to retain its root
|
||||
# status (e.g. to run commands only accessible to the system user),
|
||||
# uncomment the following line or specifiy the user option yourself:
|
||||
#
|
||||
# DAEMON_OPTS="--user root"
|
||||
37
etcs/hostapd/default/useradd
Normal file
37
etcs/hostapd/default/useradd
Normal file
@@ -0,0 +1,37 @@
|
||||
# Default values for useradd(8)
|
||||
#
|
||||
# The SHELL variable specifies the default login shell on your
|
||||
# system.
|
||||
# Similar to DHSELL in adduser. However, we use "sh" here because
|
||||
# useradd is a low level utility and should be as general
|
||||
# as possible
|
||||
SHELL=/bin/bash
|
||||
#
|
||||
# The default group for users
|
||||
# 100=users on Debian systems
|
||||
# Same as USERS_GID in adduser
|
||||
# This argument is used when the -n flag is specified.
|
||||
# The default behavior (when -n and -g are not specified) is to create a
|
||||
# primary user group with the same name as the user being added to the
|
||||
# system.
|
||||
# GROUP=100
|
||||
#
|
||||
# The default home directory. Same as DHOME for adduser
|
||||
# HOME=/home
|
||||
#
|
||||
# The number of days after a password expires until the account
|
||||
# is permanently disabled
|
||||
# INACTIVE=-1
|
||||
#
|
||||
# The default expire date
|
||||
# EXPIRE=
|
||||
#
|
||||
# The SKEL variable specifies the directory containing "skeletal" user
|
||||
# files; in other words, files such as a sample .profile that will be
|
||||
# copied to the new user's home directory when it is created.
|
||||
SKEL=/etc/skel
|
||||
#
|
||||
# Defines whether the mail spool should be created while
|
||||
# creating the account
|
||||
# CREATE_MAIL_SPOOL=yes
|
||||
|
||||
3
etcs/hostapd/dnsmasq.conf
Normal file
3
etcs/hostapd/dnsmasq.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
interface=wlan0
|
||||
dhcp-range=192.168.1.10,192.168.1.100,255.255.255.0,24h
|
||||
address=/terahz.site/192.168.1.1
|
||||
9
etcs/hostapd/hostapd.conf
Normal file
9
etcs/hostapd/hostapd.conf
Normal file
@@ -0,0 +1,9 @@
|
||||
interface=wlan0
|
||||
hw_mode=g
|
||||
channel=8
|
||||
wpa=2
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
wpa_pairwise=TKIP
|
||||
rsn_pairwise=CCMP
|
||||
ssid=TeraHz
|
||||
wpa_passphrase=terahertz
|
||||
146
etcs/hostapd/ifupdown.sh
Normal file
146
etcs/hostapd/ifupdown.sh
Normal file
@@ -0,0 +1,146 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2006-2009 Debian hostapd maintainers
|
||||
# Faidon Liambotis <paravoid@debian.org>
|
||||
# Kel Modderman <kel@otaku42.de>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# On Debian GNU/Linux systems, the text of the GPL license,
|
||||
# version 2, can be found in /usr/share/common-licenses/GPL-2.
|
||||
|
||||
# quit if we're called for lo
|
||||
if [ "$IFACE" = lo ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$IF_HOSTAPD" ]; then
|
||||
HOSTAPD_CONF="$IF_HOSTAPD"
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
HOSTAPD_BIN="/usr/sbin/hostapd"
|
||||
HOSTAPD_PNAME="hostapd"
|
||||
HOSTAPD_PIDFILE="/run/hostapd.$IFACE.pid"
|
||||
HOSTAPD_OMIT_PIDFILE="/run/sendsigs.omit.d/hostapd.$IFACE.pid"
|
||||
|
||||
if [ ! -x "$HOSTAPD_BIN" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$VERBOSITY" = "1" ]; then
|
||||
TO_NULL="/dev/stdout"
|
||||
else
|
||||
TO_NULL="/dev/null"
|
||||
fi
|
||||
|
||||
hostapd_msg () {
|
||||
case "$1" in
|
||||
verbose)
|
||||
shift
|
||||
echo "$HOSTAPD_PNAME: $@" > "$TO_NULL"
|
||||
;;
|
||||
stderr)
|
||||
shift
|
||||
echo "$HOSTAPD_PNAME: $@" > /dev/stderr
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
test_hostapd_pidfile () {
|
||||
if [ -n "$1" ] && [ -f "$2" ]; then
|
||||
if start-stop-daemon --stop --quiet --signal 0 \
|
||||
--exec "$1" --pidfile "$2"; then
|
||||
return 0
|
||||
else
|
||||
rm -f "$2"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
init_hostapd () {
|
||||
HOSTAPD_OPTIONS="-B -P $HOSTAPD_PIDFILE $HOSTAPD_CONF"
|
||||
HOSTAPD_MESSAGE="$HOSTAPD_BIN $HOSTAPD_OPTIONS"
|
||||
|
||||
test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" && return 0
|
||||
|
||||
hostapd_msg verbose "$HOSTAPD_MESSAGE"
|
||||
start-stop-daemon --start --oknodo --quiet --exec "$HOSTAPD_BIN" \
|
||||
--pidfile "$HOSTAPD_PIDFILE" -- $HOSTAPD_OPTIONS > "$TO_NULL"
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
return "$?"
|
||||
fi
|
||||
|
||||
HOSTAPD_PIDFILE_WAIT=0
|
||||
until [ -s "$HOSTAPD_PIDFILE" ]; do
|
||||
if [ "$HOSTAPD_PIDFILE_WAIT" -ge 5 ]; then
|
||||
hostapd_msg stderr \
|
||||
"timeout waiting for pid file creation"
|
||||
return 1
|
||||
fi
|
||||
|
||||
HOSTAPD_PIDFILE_WAIT=$(($HOSTAPD_PIDFILE_WAIT + 1))
|
||||
sleep 1
|
||||
done
|
||||
cat "$HOSTAPD_PIDFILE" > "$HOSTAPD_OMIT_PIDFILE"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
kill_hostapd () {
|
||||
HOSTAPD_MESSAGE="stopping $HOSTAPD_PNAME via pidfile: $HOSTAPD_PIDFILE"
|
||||
|
||||
test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" || return 0
|
||||
|
||||
hostapd_msg verbose "$HOSTAPD_MESSAGE"
|
||||
start-stop-daemon --stop --oknodo --quiet --exec "$HOSTAPD_BIN" \
|
||||
--pidfile "$HOSTAPD_PIDFILE" > "$TO_NULL"
|
||||
|
||||
[ "$HOSTAPD_OMIT_PIDFILE" ] && rm -f "$HOSTAPD_OMIT_PIDFILE"
|
||||
}
|
||||
|
||||
case "$MODE" in
|
||||
start)
|
||||
case "$PHASE" in
|
||||
pre-up)
|
||||
init_hostapd || exit 1
|
||||
;;
|
||||
*)
|
||||
hostapd_msg stderr "unknown phase: \"$PHASE\""
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
case "$PHASE" in
|
||||
post-down)
|
||||
kill_hostapd
|
||||
;;
|
||||
*)
|
||||
hostapd_msg stderr "unknown phase: \"$PHASE\""
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
hostapd_msg stderr "unknown mode: \"$MODE\""
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
19
etcs/hostapd/rc.local
Normal file
19
etcs/hostapd/rc.local
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "exit 0" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
# Print the IP address
|
||||
|
||||
cd /home/terahz/TeraHz/backend
|
||||
service lighttpd start
|
||||
flask run -h 0.0.0.0 &
|
||||
exit 0
|
||||
Reference in New Issue
Block a user