... I forgot to include the file -- sorry. Here it is:
#! /bin/bash
### BEGIN INIT INFO
# Provides: webconverger
# Required-Start: $local_fs $network
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Webconverger Live environment setup
# Description:
http://git.webconverger.org/?p=webconverger-base.git
### END INIT INFO
# Author: Kai Hendry <
hen...@webconverger.com>
# PATH should only include /usr/* if it runs after the mountnfs.sh
script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME="webconverger"
DESC="Webconverger live environment"
SCRIPTNAME=/etc/init.d/$NAME
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
# If not run as webconverger quit
# For Debian machines acting temporarily as a kiosk, see:
#
http://webconverger.org/blog/entry/Debian_Web_Kiosk/
[[ $(hostname) == $NAME ]] || exit 0
log_daemon_msg "Setting up Webconverger"
if ! grep -qs nosudo /proc/cmdline
then
if test -e /etc/nostromo.conf
then
echo DEBUG MODE ACTIVATED!
echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
/etc/init.d/nostromo start
fi
fi
amixer -s <<END
set Master 100% unmute
END
cat >> /etc/X11/xorg.conf <<WCEND
# Webconverger.com options to disable X options
#Special base config file used in Puppy Linux.
#
**********************************************************************
# Module section -- this section is used to specify
# which dynamically loadable modules to load.
#
**********************************************************************
#
Section "Module"
# This loads the DBE extension module.
Load "dbe" # Double buffer extension
# This loads the miscellaneous extensions module, and disables
# initialisation of the XFree86-DGA extension within that module.
SubSection "extmod"
Option "omit xfree86-dga" # don't initialise the DGA
extension
EndSubSection
# This loads the font modules
Load "type1"
Load "freetype"
# This loads xtrap extension, used by xrandr
Load "xtrap"
# This loads the GLX module (if present)
Load "glx"
# This loads dri module (if present)
Load "dri"
EndSection
#
**********************************************************************
# Files section. This allows default font and rgb paths to be set
#
**********************************************************************
Section "Files"
# The location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.
RgbPath "/usr/X11R7/lib/X11/rgb"
# Multiple FontPath entries are allowed (which are concatenated
together),
# as well as specifying multiple comma-separated entries in one
FontPath
# command (or a combination of both methods)
FontPath "/usr/X11R7/lib/X11/fonts/misc/"
FontPath "/usr/X11R7/lib/X11/fonts/Type1/"
FontPath "/usr/X11R7/lib/X11/fonts/TTF/"
EndSection
#
**********************************************************************
# Server flags section.
#
**********************************************************************
Section "ServerFlags"
# Uncomment this to disable the <Crtl><Alt><Fn> VT switch sequence
# (where n is 1 through 12). This allows clients to receive these key
# events.
# Option "DontVTSwitch"
# Enables mode switching with xrandr
# There is a report that this can cause Xorg not to work on some
# video hardware, so default is commented-out...
# but i want to use it in xorgwizard so leave on...
Option "RandR" "on"
EndSection
#everything past here is auto-generated by Puppy's Xorg Wizard...
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc102"
Option "XkbLayout" "it" #xkeymap0
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2" #mouse0protocol
Option "Device" "/dev/mouse"
#Option "Emulate3Buttons"
#Option "Emulate3Timeout" "50"
Option "ZAxisMapping" "4 5" #scrollwheel
EndSection
Section "Monitor"
#DisplaySize 240 180 # mm
Identifier "Monitor0"
VendorName "TOS"
ModelName "5082"
HorizSync 31.5-48.5
VertRefresh 40-70
#UseModes "Modes0" #monitor0usemodes
Option "PreferredMode" "1024x768"
EndSection
Section "Modes"
Identifier "Modes0"
#modes0modeline0
EndSection
Section "Device"
# Available Driver options are:-
# Values: <i>: integer, <f>: float, <bool>: "True"/"False",
# <string>: "String", <freq>: "<f> Hz/kHz/MHz"
# [arg]: arg optional
#Option "AccelMethod" # [<str>]
#Option "SWcursor" # [<bool>]
#Option "PciRetry" # [<bool>]
#Option "NoAccel" # [<bool>]
#Option "SetMClk" # <freq>
#Option "MUXThreshold" # <i>
#Option "ShadowFB" # [<bool>]
#Option "Rotate" # [<str>]
#Option "VideoKey" # <i>
#Option "NoMMIO" # [<bool>]
#Option "NoPciBurst" # [<bool>]
#Option "MMIOonly" # [<bool>]
#Option "CyberShadow" # [<bool>]
#Option "CyberStretch" # [<bool>]
#Option "XvHsync" # <i>
#Option "XvVsync" # <i>
#Option "XvBskew" # <i>
#Option "XvRskew" # <i>
#Option "FpDelay" # <i>
#Option "Display1400" # [<bool>]
#Option "Display" # [<str>]
#Option "GammaBrightness" # [<str>]
#Option "TVChipset" # [<str>]
#Option "TVSignal" # <i>
Identifier "Card0"
Driver "trident" #card0driver
VendorName "Trident Microsystems"
BoardName "Cyber 9525"
BusID "PCI:0:4:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "1024x768"
EndSubsection
EndSection
#PuppyHardwareProfile=Copyright_1997_TRIDENT161996
Section "ServerFlags"
Option "AllowMouseOpenFail" "true"
Option "HandleSpecialKeys" "Never"
Option "DontZoom" "true"
Option "DontZap" "true"
Option "DontVTSwitch" "true"
EndSection
WCEND
for x in $(cat /proc/cmdline); do
case $x in
homepage=*)
export HOMEPAGE=${x#homepage=}
[ $HOMEPAGE ] || HOMEPAGE="
http://portal.webconverger.com/"
[ -e /etc/opera6rc.fixed ] &&
echo "Home URL=$HOMEPAGE" >> /etc/opera6rc.fixed
[ -e /etc/iceweasel/profile/prefs.js ] &&
echo "user_pref(\"browser.startup.homepage\", \"$HOMEPAGE\");" >> /
etc/iceweasel/profile/prefs.js
;;
wlan=*)
WLAN=$(/bin/busybox httpd -d "${x//wlan=}")
essid="${WLAN%%,*}" # hack to allow for spaces in essid
key="$(echo ${WLAN} | cut -f2 -d ',')"
for iface in wlan0 eth1
do
/sbin/ifconfig $iface || continue # if the device does not exist,
skip!
ping -c 1
google.com &> /dev/null && break # ok, do not mess around
if the Internet works
if test $(cat /etc/network/interfaces | grep "^iface $iface" | wc -
l) -eq 1
then
if test "$essid"
then
echo ESSID: "$essid"
iwconfig $iface essid "$essid"
else
echo "No ESSID set (will try connect to any open network)"
iwconfig $iface essid any
fi
if test $key
then
echo KEY: $key
iwconfig $iface key $key
cat >> /etc/wpa_supplicant/wpa_supplicant.conf <<END
network={
ssid="$essid"
key_mgmt=WPA-PSK
psk="$key"
}
END
else
echo No KEY set
iwconfig $iface key off
fi
ifup $iface 2> /dev/stdout
echo ""
else
echo "No /etc/network/interfaces: $iface"
fi
done
;;
http_proxy=*)
#
http://developer.mozilla.org/en/docs/Mozilla_Networking_Preferences#Proxy
export HTTP_PROXY=${x#http_proxy=}
HOST_PORT=${HTTP_PROXY##*//}
PROXY_HOST=${HOST_PORT%%:*}
PROXY_PORT=${HOST_PORT##*:}
logger PROXY SETTINGS: $HTTP_PROXY $PROXY_HOST $PROXY_PORT
[ -e /etc/iceweasel/profile/prefs.js ] &&
echo "user_pref(\"network.proxy.type\", 1);" >> /etc/iceweasel/
profile/prefs.js
echo "user_pref(\"network.proxy.http\", \"$PROXY_HOST\");" >> /etc/
iceweasel/profile/prefs.js
echo "user_pref(\"network.proxy.http_port\", $PROXY_PORT);" >> /etc/
iceweasel/profile/prefs.js
echo "user_pref(\"network.proxy.ssl\", \"$PROXY_HOST\");" >> /etc/
iceweasel/profile/prefs.js
echo "user_pref(\"network.proxy.ssl_port\", $PROXY_PORT);" >> /etc/
iceweasel/profile/prefs.js
;;
esac
done
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
case "$?" in
0|1)
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
:
> > > - Show quoted text -- Hide quoted text -