slitaz-tools rev 739

Moved all gtkdialog boxes to oldstuff
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 28 20:21:10 2012 +0200 (2012-04-28)
parents 0a831f1f1b51
children 1d66f8010807
files oldstuff/gtkdialog/desktopbox oldstuff/gtkdialog/desktopbox-autostart.desktop oldstuff/gtkdialog/desktopbox-tazapps.desktop oldstuff/gtkdialog/netbox oldstuff/gtkdialog/netbox.desktop oldstuff/gtkdialog/scpbox oldstuff/gtkdialog/scpbox.desktop oldstuff/gtkdialog/serverbox oldstuff/gtkdialog/serverbox.desktop oldstuff/gtkdialog/sshbox oldstuff/gtkdialog/sshbox.desktop oldstuff/gtkdialog/tazhw-box.desktop rootfs/usr/share/applications/desktopbox-autostart.desktop rootfs/usr/share/applications/desktopbox-tazapps.desktop rootfs/usr/share/applications/netbox.desktop rootfs/usr/share/applications/scpbox.desktop rootfs/usr/share/applications/serverbox.desktop rootfs/usr/share/applications/sshbox.desktop rootfs/usr/share/applications/tazhw-box.desktop tinyutils/desktopbox tinyutils/netbox tinyutils/scpbox tinyutils/serverbox tinyutils/sshbox
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/oldstuff/gtkdialog/desktopbox	Sat Apr 28 20:21:10 2012 +0200
     1.3 @@ -0,0 +1,483 @@
     1.4 +#! /bin/sh
     1.5 +#
     1.6 +# Multi-call script providing GTK boxes to manage a desktop following
     1.7 +# Freedesktop standards.
     1.8 +#
     1.9 +# (C) GNU gpl v3 - SliTaz GNU/Linux 2008.
    1.10 +#
    1.11 +VERSION=20090504
    1.12 +
    1.13 +# Glade XML file path and translated messages path.
    1.14 +GLADE_XML=/usr/share/slitaz/glade
    1.15 +MESSAGES=/usr/share/slitaz/messages
    1.16 +
    1.17 +# Export script path and others if needed so we can use them in 'quote'.
    1.18 +export BIN=$0
    1.19 +export AUTOSTART_SCRIPT=$HOME/.config/openbox/autostart.sh
    1.20 +
    1.21 +# Standard directories.
    1.22 +mkdir -p $HOME/Desktop $HOME/.local/share/applications
    1.23 +
    1.24 +# Get the active locale (default to English).
    1.25 +. $MESSAGES/en/desktopbox.msg
    1.26 +        test -f $MESSAGES/${LANG%.*}/desktopbox.msg && . $MESSAGES/${LANG%.*}/desktopbox.msg
    1.27 +        test -f $MESSAGES/${LANG%_*}/desktopbox.msg && . $MESSAGES/${LANG%_*}/desktopbox.msg
    1.28 +
    1.29 +
    1.30 +# Command line usage.
    1.31 +usage()
    1.32 +{
    1.33 +	echo -e "\nSliTaz Freedesktop Box - Version: $VERSION\n
    1.34 +\033[1mUsage: \033[0m `basename $0` command
    1.35 +\033[1mCommands: \033[0m\n
    1.36 +  new-folder   Create a new folder on the desktop with mkdir.
    1.37 +  new-file     Create a new empty file or SHell script on the desktop.
    1.38 +  add-icons    Add a system icon to the desktop.
    1.39 +  notify       Display a notification message (center/no decoration).
    1.40 +               Ex: `basename $0` notify \"Message to display\" 4
    1.41 +  autostart    Manage autostarted applications with Openbox.
    1.42 +  logout       Prompt for X session exit or system halt/reboot.\n"
    1.43 +}
    1.44 +
    1.45 +# Openbox autostart functions, first column is used for icons
    1.46 +autostart_list()
    1.47 +{
    1.48 +	# Enabled
    1.49 +	for app in `cat $AUTOSTART_SCRIPT | grep ^[a-z] | awk '{ print $1 }'`
    1.50 +	do
    1.51 +		comment=`grep -B 1 "^$app" $AUTOSTART_SCRIPT | grep '^# ' | sed s/'#'//`
    1.52 +		[ -x /usr/bin/$app ] && echo "go-next | $app | $comment"
    1.53 +	done
    1.54 +	# Disabled
    1.55 +	for app in `cat $AUTOSTART_SCRIPT | grep ^#[a-z] | awk '{ print $1 }'`
    1.56 +	do
    1.57 +		comment=`grep -B 1 "^$app" $AUTOSTART_SCRIPT | grep '^# ' | sed s/'#'//`
    1.58 +		app=${app#\#}
    1.59 +		[ -x /usr/bin/$app ] && echo "stop | $app | $comment"
    1.60 +	done
    1.61 +}
    1.62 +
    1.63 +# Enable or disable autostarted applications.
    1.64 +autostart_actions()
    1.65 +{
    1.66 +	if grep -q "^$APPLICATION" $AUTOSTART_SCRIPT; then
    1.67 +		sed -i s/"^$APPLICATION"/"\#$APPLICATION"/ $AUTOSTART_SCRIPT
    1.68 +	else
    1.69 +		sed -i s/"^\#$APPLICATION"/"$APPLICATION"/ $AUTOSTART_SCRIPT
    1.70 +	fi
    1.71 +}
    1.72 +
    1.73 +add_autostarted_app()
    1.74 +{
    1.75 +	if ! grep -q "^$NEW_APP" $AUTOSTART_SCRIPT; then
    1.76 +		NEW_APP=`echo $NEW_APP | sed s/'&'/''/`
    1.77 +		echo "" >> $AUTOSTART_SCRIPT
    1.78 +		echo "# $NEW_COMMENT" >> $AUTOSTART_SCRIPT
    1.79 +		echo "$NEW_APP &" >> $AUTOSTART_SCRIPT
    1.80 +	fi
    1.81 +}
    1.82 +
    1.83 +add_autostarted_app_box()
    1.84 +{
    1.85 +	export ADD_AUTO_START_BOX='
    1.86 +<window title="Add auto started applications" icon-name="preferences-system-session">
    1.87 +<vbox>
    1.88 +	<text width-chars="54">
    1.89 +		<label>"
    1.90 +Add a new application starting with your session
    1.91 +		"</label>
    1.92 +	</text>
    1.93 +	<hbox>
    1.94 +		<text>
    1.95 +			<label>"Application:"</label>
    1.96 +		</text>
    1.97 +		<entry>
    1.98 +			<variable>NEW_APP</variable>
    1.99 +		</entry>
   1.100 +	</hbox>
   1.101 +	<hbox>
   1.102 +		<text>
   1.103 +			<label>"Comment:  "</label>
   1.104 +		</text>
   1.105 +		<entry>
   1.106 +			<variable>NEW_COMMENT</variable>
   1.107 +		</entry>
   1.108 +	</hbox>
   1.109 +	<hbox>
   1.110 +		<button ok>
   1.111 +			<action>$BIN add_autostarted_app</action>
   1.112 +			<action type="exit">exit</action>
   1.113 +		</button>
   1.114 +		<button cancel></button>
   1.115 +	</hbox>
   1.116 +</vbox>
   1.117 +</window>'
   1.118 +	gtkdialog --center --program=ADD_AUTO_START_BOX
   1.119 +}
   1.120 +
   1.121 +# Box commands.
   1.122 +
   1.123 +case $1 in
   1.124 +	new-folder)
   1.125 +		# Create a directory on the ~/Desktop.
   1.126 +		#
   1.127 +		DESKTOP_DIALOG="
   1.128 +<window title=\"Desktopbox - mkdir\" icon-name=\"folder-new\">
   1.129 +<vbox>
   1.130 +
   1.131 +	<text use-markup=\"true\" width-chars=\"40\">
   1.132 +		<label>\"
   1.133 +<b>$NEW_FOLDER_LABEL</b>\"
   1.134 +		</label>
   1.135 +	</text>
   1.136 +
   1.137 +	<hbox>
   1.138 +		<entry>
   1.139 +			<default>$FOLDER_ENTRY_MSG</default>
   1.140 +			<variable>DIR</variable>
   1.141 +		</entry>
   1.142 +	</hbox>"
   1.143 +		ACTIONS='
   1.144 +	<hbox>
   1.145 +		<button>
   1.146 +			<label>Mkdir</label>
   1.147 +			<input file icon="folder-new"></input>
   1.148 +			<action>mkdir -p "$HOME/Desktop/$DIR"</action>
   1.149 +			<action type="exit">Exit</action>
   1.150 +		</button>
   1.151 +		<button cancel>
   1.152 +			<action type="exit">Exit</action>
   1.153 +		</button>
   1.154 +	</hbox>
   1.155 +
   1.156 +</vbox>
   1.157 +</window>'
   1.158 +		export DESKTOP_DIALOG="${DESKTOP_DIALOG}${ACTIONS}" ;;
   1.159 +	new-file)
   1.160 +		# Create a file on the ~/Desktop.
   1.161 +		#
   1.162 +		DESKTOP_DIALOG="
   1.163 +<window title=\"Desktopbox - touch/cat\" icon-name=\"document-new\">
   1.164 +<vbox>
   1.165 +	<text use-markup=\"true\" width-chars=\"40\">
   1.166 +		<label>\"
   1.167 +<b>$NEW_FILE_LABEL</b>\"
   1.168 +		</label>
   1.169 +	</text>
   1.170 +
   1.171 +	<hbox>
   1.172 +		<entry>
   1.173 +			<default>$FILE_ENTRY_MSG</default>
   1.174 +			<variable>FILE</variable>
   1.175 +		</entry>
   1.176 +	</hbox>"
   1.177 +		ACTIONS='
   1.178 +	<hbox>
   1.179 +		<button>
   1.180 +			<label>SH script</label>
   1.181 +			<input file icon="document-new"></input>
   1.182 +			<action>echo "#!/bin/sh" > "$HOME/Desktop/$FILE"</action>
   1.183 +			<action>echo "#" >> "$HOME/Desktop/$FILE"</action>
   1.184 +			<action>chmod +x "$HOME/Desktop/$FILE"</action>
   1.185 +			<action type="exit">Exit</action>
   1.186 +		</button>
   1.187 +		<button>
   1.188 +			<label>Empty</label>
   1.189 +			<input file icon="document-new"></input>
   1.190 +			<action>touch "$HOME/Desktop/$FILE"</action>
   1.191 +			<action type="exit">Exit</action>
   1.192 +		</button>
   1.193 +		<button cancel>
   1.194 +			<action type="exit">Exit</action>
   1.195 +		</button>
   1.196 +	</hbox>
   1.197 +</vbox>
   1.198 +</window>'
   1.199 +		export DESKTOP_DIALOG="${DESKTOP_DIALOG}${ACTIONS}" ;;
   1.200 +	add-icons)
   1.201 +		# Add new icons on the ~/Desktop from /usr/share/applications.
   1.202 +		#
   1.203 +		DESKTOP_DIALOG="
   1.204 +<window title=\"$ADD_ICON_LABEL\" icon-name=\"document-new\">
   1.205 +<vbox>
   1.206 +	<text use-markup=\"true\" width-chars=\"40\">
   1.207 +		<label>\"
   1.208 +<b>$ADD_ICON_LABEL</b>
   1.209 +\"
   1.210 +		</label>
   1.211 +	</text>
   1.212 +	<tree headers_visible=\"false\">
   1.213 +		<width>420</width><height>200</height>
   1.214 +		<variable>ICON</variable>
   1.215 +		<label>Filename|Application</label>"
   1.216 +		# Get application name and icon.
   1.217 +		cd /usr/share/applications
   1.218 +		for file in *.desktop
   1.219 +		do
   1.220 +			# Try to get the name in the right locale.
   1.221 +			NAME=`grep ^Name $file | grep $lang || grep ^Name= $file`
   1.222 +			NAME=`echo $NAME | cut -d "=" -f 2`
   1.223 +			ICON=`grep ^Icon= $file | cut -d "=" -f 2`
   1.224 +			ICON=`basename $ICON`
   1.225 +			ICON=${ICON%.*}
   1.226 +			FILE=${file%.desktop}
   1.227 +			ITEM="<item icon=\"$ICON\">$FILE | $NAME</item>"
   1.228 +			DESKTOP_DIALOG="${DESKTOP_DIALOG}${ITEM}"
   1.229 +		done
   1.230 +		ACTIONS='<action>cp /usr/share/applications/$ICON.desktop ~/Desktop</action>
   1.231 +	</tree>
   1.232 +	<hbox>
   1.233 +		<button>
   1.234 +			<label>Add</label>
   1.235 +			<input file icon="gtk-add"></input>
   1.236 +			<action>cp /usr/share/applications/$ICON.desktop ~/Desktop</action>
   1.237 +		</button>
   1.238 +		<button>
   1.239 +			<label>Exit</label>
   1.240 +			<input file icon="exit"></input>
   1.241 +			<action type="exit">Exit</action>
   1.242 +		</button>
   1.243 +	</hbox>
   1.244 +</vbox>
   1.245 +</window>'
   1.246 +		export DESKTOP_DIALOG=${DESKTOP_DIALOG}${ACTIONS} ;;
   1.247 +	logout)
   1.248 +		# X session/system logout.
   1.249 +		#
   1.250 +		DESKTOP_DIALOG="
   1.251 +<window title=\"SliTaz Desktop logout\" icon-name=\"user-desktop\" skip_taskbar_hint=\"true\">
   1.252 +<vbox>
   1.253 +	<pixmap>
   1.254 +		<input file>/usr/share/icons/Tango/32x32/places/user-desktop.png</input>
   1.255 +	</pixmap>
   1.256 +	<hbox>
   1.257 +		<text use-markup=\"true\" width-chars=\"$CHARS_SIZE\">
   1.258 +			<label>
   1.259 +\"<b>$DESKTOP_DIALOG_LABEL</b>
   1.260 +\"
   1.261 +			</label>
   1.262 +		</text>
   1.263 +	</hbox>"
   1.264 +		TAZUSB_DIALOG="
   1.265 +	<hbox>
   1.266 +		<checkbox>
   1.267 +			<label>$DESKTOP_DIALOG_TAZUSB</label>
   1.268 +			<variable>TAZUSB_WRITE</variable>
   1.269 +			<default>false</default>
   1.270 +		</checkbox>
   1.271 +		<radiobutton>
   1.272 +			<label>lzma</label>
   1.273 +			<variable>LZMA</variable>
   1.274 +		</radiobutton>
   1.275 +		<radiobutton active=\"true\">
   1.276 +			<label>gzip</label>
   1.277 +			<variable>GZIP</variable>
   1.278 +		</radiobutton>
   1.279 +		<radiobutton>
   1.280 +			<label>none</label>
   1.281 +			<variable>NONE</variable>
   1.282 +		</radiobutton>
   1.283 +	</hbox>"
   1.284 +		EXTRA="COMP=none; [ \$LZMA = true ] && COMP=lzma; [ \$GZIP = true ] && COMP=gzip; [ \$TAZUSB_WRITE = true ] && { subox \"xterm -e '/usr/bin/tazusb writefs \$COMP'\"; sleep 1; while ps x | grep -v grep | grep -q tazusb; do sleep 1; done; };"
   1.285 +		[ -f /home/boot/rootfs.gz ] || { TAZUSB_DIALOG=""; EXTRA=""; }
   1.286 +		# Logout for Openbox or JWM and system shutdown or reboot.
   1.287 +		ACTIONS="
   1.288 +	<hbox>
   1.289 +		<button>
   1.290 +			<label>$DESKTOP_LOGOUT_BUTTON</label>
   1.291 +			<input file icon=\"video-display\"></input>
   1.292 +			<action>$EXTRA openbox --exit || jwm -exit</action>
   1.293 +			<action type=\"exit\">Exit</action>
   1.294 +		</button>
   1.295 +		<button>
   1.296 +			<label>$DESKTOP_SHUTDOWN_BUTTON</label>
   1.297 +			<input file icon=\"system-shutdown\"></input>
   1.298 +			<action>$EXTRA poweroff</action>
   1.299 +			<action type=\"exit\">Exit</action>
   1.300 +		</button>
   1.301 +		<button>
   1.302 +			<label>$DESKTOP_REBOOT_BUTTON</label>
   1.303 +			<input file icon=\"reload\"></input>
   1.304 +			<action>$EXTRA reboot</action>
   1.305 +			<action type=\"exit\">Exit</action>
   1.306 +		</button>
   1.307 +		<button cancel>
   1.308 +			<action type=\"exit\">Exit</action>
   1.309 +		</button>
   1.310 +	</hbox>
   1.311 +</vbox>
   1.312 +</window>"
   1.313 +		export DESKTOP_DIALOG=${DESKTOP_DIALOG}${TAZUSB_DIALOG}${ACTIONS} ;;
   1.314 +	notify)
   1.315 +		# Notification message without window decoration.
   1.316 +		MSG="$2"
   1.317 +		SEC=$3
   1.318 +		[ -z $SEC ] && SEC=4
   1.319 +		export NOTIFY_BOX="
   1.320 +<window decorated=\"false\" skip_taskbar_hint=\"true\">
   1.321 +<vbox>
   1.322 +	<text width-chars=\"64\" use-markup=\"true\">
   1.323 +		<label>\"
   1.324 +<b>$MSG</b>
   1.325 +		\"</label>
   1.326 +	</text>
   1.327 +</vbox>
   1.328 +</window>"
   1.329 +		gtkdialog --center --program=NOTIFY_BOX >/dev/null &
   1.330 +		sleep $SEC
   1.331 +		pid=`ps | grep NOTIFY_BOX | awk '{ print $1 }'`
   1.332 +		kill $pid 2>/dev/null
   1.333 +		exit 0 ;;
   1.334 +	autostart)
   1.335 +		# Autostarted apps management. Functions are used for input 
   1.336 +		# and actions
   1.337 +		export DESKTOP_DIALOG='
   1.338 +<window title="Auto start applications with Openbox" icon-name="preferences-system-session">
   1.339 +<vbox>
   1.340 +	<tree>
   1.341 +		<width>540</width><height>200</height>
   1.342 +		<variable>APPLICATION</variable>
   1.343 +		<label>Application|Comment</label>
   1.344 +		<input icon_column="0">$BIN autostart_list</input>
   1.345 +		<action>$BIN autostart_actions</action>
   1.346 +		<action>refresh:APPLICATION</action>
   1.347 +	</tree>
   1.348 +	<hbox>
   1.349 +		<text width-chars="36">
   1.350 +				<label>
   1.351 +"Double click to enable/disable an application"
   1.352 +				</label>
   1.353 +			</text>
   1.354 +		<button>
   1.355 +			<label>Add</label>
   1.356 +			<input file icon="gtk-add"></input>
   1.357 +			<action>$BIN add_autostarted_app_box</action>
   1.358 +			<action>refresh:APPLICATION</action>
   1.359 +		</button>
   1.360 +		<button>
   1.361 +			<label>Configuration</label>
   1.362 +			<input file icon="accessories-text-editor"></input>
   1.363 +			<action>editor $AUTOSTART_SCRIPT</action>
   1.364 +			<action>refresh:APPLICATION</action>
   1.365 +		</button>
   1.366 +		<button>
   1.367 +			<label>Exit</label>
   1.368 +			<input file icon="exit"></input>	
   1.369 +			<action type="exit">exit</action>
   1.370 +		</button>
   1.371 +	</hbox>
   1.372 +</vbox>
   1.373 +</window>'
   1.374 +		;;
   1.375 +	tazapps)
   1.376 +		# Default applications configuration script. System wide config file
   1.377 +		# is /etc/slitaz/applications.conf and each user can have personal
   1.378 +		# settings. System wide for root and personal config for user.
   1.379 +		export CONFIG="$HOME/.config/slitaz/applications.conf"
   1.380 +		if [ ! -f $CONFIG ]; then
   1.381 +			mkdir -p $HOME/.config/slitaz
   1.382 +			cp /etc/slitaz/applications.conf $CONFIG
   1.383 +		fi
   1.384 +		export DESKTOP_DIALOG='
   1.385 +<window title="SliTaz default applications" icon-name="preferences-desktop">
   1.386 +<vbox>
   1.387 +	<vbox>
   1.388 +		<text use-markup="true" width-chars="54">
   1.389 +			<label>"
   1.390 +<b>SliTaz default applications configuration</b>
   1.391 +			"</label>
   1.392 +		</text>
   1.393 +	</vbox>
   1.394 +	<hbox>
   1.395 +		<text wrap="false">
   1.396 +			<label>"File manager:       "</label>
   1.397 +		</text>
   1.398 +		<entry>
   1.399 +			<input>. $CONFIG; echo $FILE_MANAGER</input>
   1.400 +			<variable>FILE_MANAGER</variable>
   1.401 +		</entry>
   1.402 +		<button>
   1.403 +			<label>Change</label>
   1.404 +			<input file icon="forward"></input>
   1.405 +			<action>sed -i s/"FILE_MANAGER=.*"/"FILE_MANAGER=\"$FILE_MANAGER\""/ $CONFIG</action>
   1.406 +		</button>
   1.407 +	</hbox>
   1.408 +	<hbox>
   1.409 +		<text wrap="false">
   1.410 +			<label>"Web browser:      "</label>
   1.411 +		</text>
   1.412 +		<entry>
   1.413 +			<input>. $CONFIG; echo $BROWSER</input>
   1.414 +			<variable>BROWSER</variable>
   1.415 +		</entry>
   1.416 +		<button>
   1.417 +			<label>Change</label>
   1.418 +			<input file icon="forward"></input>
   1.419 +			<action>sed -i s/"BROWSER=.*"/"BROWSER=\"$BROWSER\""/ $CONFIG</action>
   1.420 +		</button>
   1.421 +	</hbox>
   1.422 +	<hbox>
   1.423 +		<text wrap="false">
   1.424 +			<label>"Text editor:          "</label>
   1.425 +		</text>
   1.426 +		<entry>
   1.427 +			<input>. $CONFIG; echo $EDITOR</input>
   1.428 +			<variable>EDITOR</variable>
   1.429 +		</entry>
   1.430 +		<button>
   1.431 +			<label>Change</label>
   1.432 +			<input file icon="forward"></input>
   1.433 +			<action>sed -i s/"EDITOR=.*"/"EDITOR=\"$EDITOR\""/ $CONFIG</action>
   1.434 +		</button>
   1.435 +	</hbox>
   1.436 +	<hbox>
   1.437 +		<text wrap="false">
   1.438 +			<label>"Terminal:              "</label>
   1.439 +		</text>
   1.440 +		<entry>
   1.441 +			<input>. $CONFIG; echo $TERMINAL</input>
   1.442 +			<variable>TERMINAL</variable>
   1.443 +		</entry>
   1.444 +		<button>
   1.445 +			<label>Change</label>
   1.446 +			<input file icon="forward"></input>
   1.447 +			<action>sed -i s/"TERMINAL=.*"/"TERMINAL=\"$TERMINAL\""/ $CONFIG</action>
   1.448 +		</button>
   1.449 +	</hbox>
   1.450 +	<hbox>
   1.451 +		<text wrap="false">
   1.452 +			<label>"Window manager:"</label>
   1.453 +		</text>
   1.454 +		<entry>
   1.455 +			<input>. $CONFIG; echo $WINDOW_MANAGER</input>
   1.456 +			<variable>WINDOW_MANAGER</variable>
   1.457 +		</entry>
   1.458 +		<button>
   1.459 +			<label>Change</label>
   1.460 +			<input file icon="forward"></input>
   1.461 +			<action>sed -i s/"WINDOW_MANAGER=.*"/"WINDOW_MANAGER=\"$WINDOW_MANAGER\""/ $CONFIG</action>
   1.462 +		</button>
   1.463 +	</hbox>
   1.464 +	<hbox>
   1.465 +		<button>
   1.466 +			<label>Exit</label>
   1.467 +			<input file icon="exit"></input>	
   1.468 +			<action type="exit">exit</action>
   1.469 +		</button>
   1.470 +	</hbox>
   1.471 +</vbox>
   1.472 +</window>' ;;
   1.473 +	*_*)
   1.474 +		# Exec all function called by args (must have an underscore).
   1.475 +		$1
   1.476 +		exit 0 ;;
   1.477 +	*)
   1.478 +		# Usage if executed from cmdline.
   1.479 +		#
   1.480 +		usage
   1.481 +		exit 0 ;;
   1.482 +esac
   1.483 +
   1.484 +gtkdialog --center --program=DESKTOP_DIALOG >/dev/null
   1.485 +
   1.486 +exit 0
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/oldstuff/gtkdialog/desktopbox-autostart.desktop	Sat Apr 28 20:21:10 2012 +0200
     2.3 @@ -0,0 +1,9 @@
     2.4 +[Desktop Entry]
     2.5 +Encoding=UTF-8
     2.6 +Name=Auto started applications
     2.7 +Name[pt]=Aplicações Auto Iniciadas
     2.8 +Name[pt_BR]=Aplicações Auto Iniciadas
     2.9 +Icon=gnome-session
    2.10 +Exec=desktopbox autostart
    2.11 +Type=Application
    2.12 +Categories=Settings;DesktopSettings;GTK;
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/oldstuff/gtkdialog/desktopbox-tazapps.desktop	Sat Apr 28 20:21:10 2012 +0200
     3.3 @@ -0,0 +1,10 @@
     3.4 +[Desktop Entry]
     3.5 +Encoding=UTF-8
     3.6 +Name=Favorite applications
     3.7 +Name[fr]=Applications favorites
     3.8 +Name[pt]=Aplicativos Favoritos
     3.9 +Name[pt_BR]=Aplicativos Favoritos
    3.10 +Icon=preferences-desktop
    3.11 +Exec=desktopbox tazapps
    3.12 +Type=Application
    3.13 +Categories=Settings;DesktopSettings;
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/oldstuff/gtkdialog/netbox	Sat Apr 28 20:21:10 2012 +0200
     4.3 @@ -0,0 +1,1092 @@
     4.4 +#!/bin/sh
     4.5 +#
     4.6 +# Gtkdialog box to manage network connections and servers.
     4.7 +# Please use tab to indent.
     4.8 +#
     4.9 +# (c) - SliTaz GNU/Linux 2009.
    4.10 +#
    4.11 +VERSION=20100315
    4.12 +
    4.13 +. /usr/lib/slitaz/gui_functions
    4.14 +
    4.15 +# Check if user is root.
    4.16 +check_root()
    4.17 +{
    4.18 +	if test $(id -u) != 0 ; then
    4.19 +		echo -e "
    4.20 +You must be root to run `basename $0`. Please type 'su' and
    4.21 +root password to become super-user.\n"
    4.22 +		exit 0
    4.23 +	fi
    4.24 +}
    4.25 +
    4.26 +
    4.27 +#
    4.28 +# Functions called by the connection tab to list interfaces.
    4.29 +#
    4.30 +############################################################
    4.31 +
    4.32 +interface_status()
    4.33 +{
    4.34 +	if 	ifconfig | grep -A 1 $i | grep -q inet; then
    4.35 +		ip=`ifconfig | grep -A 1 $i | grep inet | awk '{ print $2 }' | cut -d ":" -f 2`
    4.36 +		echo "connected ($ip)"
    4.37 +	else
    4.38 +		echo "-"
    4.39 +	fi
    4.40 +}
    4.41 +# First column is for icon name.
    4.42 +detect_interfaces()
    4.43 +{
    4.44 +	for i in `ls /sys/class/net`
    4.45 +	do
    4.46 +		case $i in
    4.47 +			eth*)
    4.48 +				echo "network-wired | $i | Ethernet | `interface_status`" ;;
    4.49 +			wlan*|ath*|ra*)
    4.50 +				echo "network-wireless | $i | Wireless | `interface_status`" ;;
    4.51 +			lo)
    4.52 +				echo "gtk-network | $i | Loopback | `interface_status`" ;;
    4.53 +			*)
    4.54 +				continue ;;
    4.55 +		esac
    4.56 +	done
    4.57 +}
    4.58 +
    4.59 +# When users double click on a connection.
    4.60 +interfaces_List_actions()
    4.61 +{
    4.62 +	echo "$INTERFACE_LIST"
    4.63 +}
    4.64 +
    4.65 +# Netbox can be called with args.
    4.66 +case "$1" in
    4.67 +	detect_interfaces|interfaces_List_actions)
    4.68 +		$1
    4.69 +		exit 0 ;;
    4.70 +	*)
    4.71 +		continue ;;
    4.72 +esac
    4.73 +
    4.74 +set_ipup()
    4.75 +{
    4.76 +	[ -f /etc/ppp/ip-up ] && return
    4.77 +	cat > /etc/ppp/ip-up <<EOT
    4.78 +#!/bin/sh
    4.79 +exec $0 call ipup \$@
    4.80 +EOT
    4.81 +	chmod +x /etc/ppp/ip-up
    4.82 +}
    4.83 +
    4.84 +while true; do
    4.85 +
    4.86 +# Detect WIFI_INTERFACE and update /etc/network.conf
    4.87 +. /etc/network.conf
    4.88 +if [ ! -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then
    4.89 +	WIFI_INTERFACE=$(for i in /sys/class/net/*/wireless; do \
    4.90 +		[ -d $i ] && echo $(basename $(dirname $i)) || echo wlan0; \
    4.91 +		break; done)
    4.92 +	[ -n "$WIFI_INTERFACE" ] && sed -i "s/^WIFI_INTERFACE=.*/WIFI_INTERFACE=\"$WIFI_INTERFACE\"/" /etc/network.conf
    4.93 +fi
    4.94 +
    4.95 +#
    4.96 +# Netbox internal calls
    4.97 +#
    4.98 +#########################################################
    4.99 +
   4.100 +if [ "$1" = "call" ]; then
   4.101 +	ppp="pppd local lock notty"
   4.102 +	pppup=""
   4.103 +	sub=$2
   4.104 +	shift 2
   4.105 +	case "$sub" in
   4.106 +	sendsshkey)
   4.107 +		check_root
   4.108 +		( dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key ;
   4.109 +		  cat /etc/ssh/ssh_host_rsa_key.pub ) 2> /dev/null | \
   4.110 +		grep ^ssh | ssh $1 "mkdir .ssh 2> /dev/null ; \
   4.111 +while read key; do for i in authorized_keys authorized_keys2; do \
   4.112 +grep -qs '\$key' .ssh/\$i || echo '\$key' >> .ssh/\$i ; done ; done ; \
   4.113 +chmod 700 .ssh ; chmod 600 .ssh/authorized_keys*"
   4.114 +		exit 0;;
   4.115 +# OpenSSH VPN:
   4.116 +#   PermitTunnel=point-to-point   (or yes, ethernet, no)
   4.117 +#   Tunnel="4" => tun4
   4.118 +#   Local Client:
   4.119 +#     # ssh -f -w 0:1 $REMOTE true  => local tun0 [, remote tun1]
   4.120 +#     # ifconfig $TUN $IP1 $IP2 netmask 255.255.255.252
   4.121 +#     # route add $REMOTE_NETWORK $IP2
   4.122 +#   Remote Server:
   4.123 +#     # ifconfig $TUN $IP2 $IP1 netmask 255.255.255.252
   4.124 +#     # route add $LOCAL_NETWORK $IP1
   4.125 +	vpnssh)	check_root
   4.126 +		set_ipup
   4.127 +		ps ww | grep -q "$ppp $2:$3" && exit 1
   4.128 +		pipe="/tmp/ssh$$"
   4.129 +		mkfifo $pipe
   4.130 +		[ -n "$4" ] && pppup="ipparam 'addroutes,$(echo $4 | sed 's/ /,/g')'"
   4.131 +		cat $pipe | dbclient -i /etc/dropbear/dropbear_rsa_host_key \
   4.132 +		$1 "$ppp" | $ppp $2:$3 $pppup > $pipe
   4.133 +		rm -f $pipe
   4.134 +		exit 0;;
   4.135 +	killvpnssh)
   4.136 +		check_root
   4.137 +		kill $(ps x | grep dbclient | grep "$ppp" | awk '{ print $1 }')
   4.138 +		exit 0;;
   4.139 +	ipup)
   4.140 +#    Arg  Name                          Example
   4.141 +#    $1   Interface name                ppp0
   4.142 +#    $2   The tty                       ttyS1
   4.143 +#    $3   The link speed                38400
   4.144 +#    $4   Local IP number               12.34.56.78
   4.145 +#    $5   Peer  IP number               12.34.56.99
   4.146 +#    $6   Optional ``ipparam'' value    foo
   4.147 +		iface=$1
   4.148 +		# skip tty if present
   4.149 +		case "$2" in [0-9]*);; *) shift; esac
   4.150 +		peer=$4
   4.151 +		IFS=","; set -- $(eval echo $5); unset IFS
   4.152 +		set -- $1
   4.153 +		if [ "$1" = "addroutes" ]; then
   4.154 +			while [ -n "$2" ]; do
   4.155 +				eval $(ipcalc -n $2)
   4.156 +				eval $(ipcalc -m $2)
   4.157 +				route add -net $NETWORK netmask $NETMASK \
   4.158 +					gw $peer $iface
   4.159 +				shift
   4.160 +			done
   4.161 +		fi
   4.162 +		exit 0;;
   4.163 +	esac
   4.164 +	echo "call $sub unsupported."
   4.165 +	exit 1
   4.166 +fi
   4.167 +
   4.168 +
   4.169 +
   4.170 +#
   4.171 +# Status wire interfaces
   4.172 +#
   4.173 +tab_status_iface()
   4.174 +{
   4.175 +local eth
   4.176 +eth="$( (cd /sys/class/net ; [ -d eth0 ] && ls -d eth* ) )"
   4.177 +which ethtool > /dev/null || eth=''
   4.178 +if [ -n "$eth" ]; then
   4.179 +    cat <<EOT
   4.180 +<notebook labels="Ifconfig|$(echo $eth | sed 's/ /|/g')">
   4.181 +EOT
   4.182 +fi
   4.183 +cat <<EOT
   4.184 +<frame Ifconfig>
   4.185 +	<text wrap="false" width-chars="58">
   4.186 +		<input>ifconfig</input>
   4.187 +	</text>
   4.188 +</frame>
   4.189 +EOT
   4.190 +if [ -n "$eth" ]; then
   4.191 +    local i
   4.192 +    for i in $eth ; do
   4.193 +        cat <<EOT
   4.194 +<frame $i>
   4.195 +	<text wrap="false" width-chars="58">
   4.196 +		<input>ethtool $i</input>
   4.197 +	</text>
   4.198 +</frame>
   4.199 +EOT
   4.200 +    done
   4.201 +    cat <<EOT
   4.202 +</notebook>
   4.203 +EOT
   4.204 +fi
   4.205 +}
   4.206 +
   4.207 +#
   4.208 +# Status wifi interfaces
   4.209 +#
   4.210 +tab_status_wifi_iface()
   4.211 +{
   4.212 +cat <<EOT
   4.213 +<frame Iwconfig>
   4.214 +	<text wrap="false" width-chars="58">
   4.215 +		<input>iwconfig</input>
   4.216 +	</text>
   4.217 +</frame>
   4.218 +EOT
   4.219 +}
   4.220 +
   4.221 +#
   4.222 +# Status wifi network
   4.223 +#
   4.224 +tab_status_wifi_net()
   4.225 +{
   4.226 +cat <<EOT
   4.227 +<frame Wireless networks>
   4.228 +	<text wrap="false" width-chars="58">
   4.229 +		<input>iwlist scan</input>
   4.230 +	</text>
   4.231 +</frame>
   4.232 +EOT
   4.233 +}
   4.234 +
   4.235 +#
   4.236 +# Status routing
   4.237 +#
   4.238 +tab_status_route()
   4.239 +{
   4.240 +cat <<EOT
   4.241 +<frame Routing>
   4.242 +	<frame Nameservers>
   4.243 +		<text wrap="false" width-chars="58">
   4.244 +			<input>cat /etc/resolv.conf</input>
   4.245 +		</text>
   4.246 +	</frame>
   4.247 +	<frame Routing table>
   4.248 +		<text wrap="false" width-chars="58">
   4.249 +			<input>route</input>
   4.250 +		</text>
   4.251 +	</frame>
   4.252 +	<frame Arp table>
   4.253 +		<text wrap="false" width-chars="58">
   4.254 +			<input>arp</input>
   4.255 +		</text>
   4.256 +	</frame>
   4.257 +</frame>
   4.258 +EOT
   4.259 +}
   4.260 +
   4.261 +data_status()
   4.262 +{
   4.263 +cat <<EOT
   4.264 +ifconfig    Network\ interfaces   tab_status_iface
   4.265 +iwconfig    Wireless\ interfaces  tab_status_wifi_iface
   4.266 +iwlist      Wireless\ networks    tab_status_wifi_net
   4.267 +route       Routing               tab_status_route
   4.268 +EOT
   4.269 +}
   4.270 +
   4.271 +#
   4.272 +# Status
   4.273 +#
   4.274 +tab_status()
   4.275 +{
   4.276 +use_tab data_status
   4.277 +}
   4.278 +
   4.279 +#
   4.280 +# Interfaces list from detect_interfaces()
   4.281 +#
   4.282 +tab_connections()
   4.283 +{
   4.284 +cat <<EOT
   4.285 +	<vbox>
   4.286 +		<tree>
   4.287 +			<width>520</width><height>120</height>
   4.288 +			<variable>INTERFACE_LIST</variable>
   4.289 +			<label>Interface|Type|Status</label>
   4.290 +			<input icon_column="0">$0 detect_interfaces</input>
   4.291 +			<action>refresh:INTERFACE_LIST</action>
   4.292 +		</tree>
   4.293 +	</vbox>
   4.294 +EOT
   4.295 +}
   4.296 +
   4.297 +#
   4.298 +# DHCP
   4.299 +#
   4.300 +tab_udhcpc()
   4.301 +{
   4.302 +cat <<EOT
   4.303 +<frame Udhcpc (busybox)>
   4.304 +	<text width-chars="58">
   4.305 +		<label> "Ethernet (cable) default connection." </label>
   4.306 +	</text>
   4.307 +	<hbox>
   4.308 +		<text use-markup="true">
   4.309 +			<label>"<b>Interface:</b>"</label>
   4.310 +		</text>
   4.311 +		<entry>
   4.312 +			<input>. /etc/network.conf; echo "\$INTERFACE"</input>
   4.313 +			<variable>INTERFACE</variable>
   4.314 +		</entry>
   4.315 +	</hbox>
   4.316 +	<hbox>
   4.317 +		<text use-markup="true">
   4.318 +			<label>"<b>Options:  </b>"</label>
   4.319 +		</text>
   4.320 +		<entry>
   4.321 +			<default>-b</default>
   4.322 +			<variable>UDHCPC_OPTS</variable>
   4.323 +		</entry>
   4.324 +$(helpbutton udhcpc 80x30)
   4.325 +	</hbox>
   4.326 +	<hbox>
   4.327 +		<text use-markup="true">
   4.328 +			<label>"<b>Script:     </b>"</label>
   4.329 +		</text>
   4.330 +		<entry editable="false">
   4.331 +			<default>/usr/share/udhcpc/default.script</default>
   4.332 +			<variable>UDHCPC_SCRIPT</variable>
   4.333 +		</entry>
   4.334 +$(editbutton \$UDHCPC_SCRIPT)
   4.335 +	</hbox>
   4.336 +	<hbox>
   4.337 +		<button>
   4.338 +			<label>Start</label>
   4.339 +			<input file icon="forward"></input>
   4.340 +			<action>sed -i s/^INTERFACE=.*/INTERFACE=\"\$INTERFACE\"/ /etc/network.conf</action>
   4.341 +			<action>sed -i s/^DHCP=.*/DHCP=\"yes\"/ /etc/network.conf</action>
   4.342 +			<action>sed -i s/^STATIC=.*/STATIC=\"no\"/ /etc/network.conf</action>
   4.343 +			<action>udhcpc \$UDHCPC_OPTS -i \$INTERFACE -p /var/run/udhcpc.\$INTERFACE.pid</action>
   4.344 +			<action>refresh:INTERFACE_LIST</action>
   4.345 +		</button>
   4.346 +		<button>
   4.347 +			<label>Stop</label>
   4.348 +			<input file icon="stop"></input>
   4.349 +			<action>echo -n "Stopping interface : \$INTERFACE... "</action>
   4.350 +			<action>ifconfig \$INTERFACE down</action>
   4.351 +			<action>killall -q udhcpc; echo "done"</action>
   4.352 +			<action>refresh:INTERFACE_LIST</action>
   4.353 +		</button>
   4.354 +	</hbox>
   4.355 +</frame>
   4.356 +EOT
   4.357 +}
   4.358 +
   4.359 +#
   4.360 +# Static/fixed IP settings.
   4.361 +#
   4.362 +tab_fixed_ip()
   4.363 +{
   4.364 +cat <<EOT
   4.365 +<frame Ethernet fixed IP>
   4.366 +	<hbox>
   4.367 +		<text use-markup="true">
   4.368 +			<label>"<b>Interface:   </b>"</label>
   4.369 +		</text>
   4.370 +		<entry>
   4.371 +			<input>. /etc/network.conf; echo "\$INTERFACE"</input>
   4.372 +			<variable>INTERFACE</variable>
   4.373 +		</entry>
   4.374 +	</hbox>
   4.375 +	<hbox>
   4.376 +		<text use-markup="true">
   4.377 +			<label>"<b>IP:                </b>"</label>
   4.378 +		</text>
   4.379 +		<entry>
   4.380 +			<input>. /etc/network.conf; echo "\$IP"</input>
   4.381 +			<variable>IP</variable>
   4.382 +		</entry>
   4.383 +	</hbox>
   4.384 +	<hbox>
   4.385 +		<text use-markup="true">
   4.386 +			<label>"<b>Netmask:    </b>"</label>
   4.387 +		</text>
   4.388 +		<entry>
   4.389 +			<input>. /etc/network.conf; echo "\$NETMASK"</input>
   4.390 +			<variable>NETMASK</variable>
   4.391 +		</entry>
   4.392 +	</hbox>
   4.393 +	<hbox>
   4.394 +		<text use-markup="true">
   4.395 +			<label>"<b>Gateway:    </b>"</label>
   4.396 +		</text>
   4.397 +		<entry>
   4.398 +			<input>. /etc/network.conf; echo "\$GATEWAY"</input>
   4.399 +			<variable>GATEWAY</variable>
   4.400 +		</entry>
   4.401 +	</hbox>
   4.402 +	<hbox>
   4.403 +		<text use-markup="true">
   4.404 +			<label>"<b>DNS server: </b>"</label>
   4.405 +		</text>
   4.406 +		<entry>
   4.407 +			<input>. /etc/network.conf; echo "\$DNS_SERVER"</input>
   4.408 +			<variable>DNS_SERVER</variable>
   4.409 +		</entry>
   4.410 +	</hbox>
   4.411 +	<hbox>
   4.412 +		<button>
   4.413 +		<label>Start</label>
   4.414 +			<input file icon="forward"></input>
   4.415 +			<action>ifconfig lo down</action>
   4.416 +			<action>ifconfig \$INTERFACE down</action>
   4.417 +			<action>sed -i s/^INTERFACE=.*/INTERFACE=\"\$INTERFACE\"/ /etc/network.conf</action>
   4.418 +			<action>sed -i s/^DHCP=.*/DHCP=\"no\"/ /etc/network.conf</action>
   4.419 +			<action>sed -i s/^WIFI=.*/WIFI=\"no\"/ /etc/network.conf</action>
   4.420 +			<action>sed -i s/^STATIC=.*/STATIC=\"yes\"/ /etc/network.conf</action>
   4.421 +			<action>sed -i s/^IP=.*/IP=\"\$IP\"/ /etc/network.conf</action>
   4.422 +			<action>sed -i s/^NETMASK=.*/NETMASK=\"\$NETMASK\"/ /etc/network.conf</action>
   4.423 +			<action>sed -i s/^GATEWAY=.*/GATEWAY=\"\$GATEWAY\"/ /etc/network.conf</action>
   4.424 +			<action>sed -i s/^DNS_SERVER=.*/DNS_SERVER=\"\$DNS_SERVER\"/ /etc/network.conf</action>
   4.425 +			<action>/etc/init.d/network.sh</action>
   4.426 +			<action>refresh:INTERFACE_LIST</action>
   4.427 +		</button>
   4.428 +		<button>
   4.429 +			<label>Stop</label>
   4.430 +			<input file icon="stop"></input>
   4.431 +			<action>ifconfig \$INTERFACE down</action>
   4.432 +			<action>refresh:INTERFACE_LIST</action>
   4.433 +		</button>
   4.434 +	</hbox>
   4.435 +</frame>
   4.436 +EOT
   4.437 +}
   4.438 +
   4.439 +#
   4.440 +# PPPoE settings.
   4.441 +#
   4.442 +tab_pppoe()
   4.443 +{
   4.444 +cat <<EOT
   4.445 +<frame PPPoE>
   4.446 +	<hbox>
   4.447 +		<text use-markup="true">
   4.448 +			<label>"<b>Username:</b>"</label>
   4.449 +		</text>
   4.450 +		<entry>
   4.451 +			<input>PPoE_ID=\$(grep -s ^name /etc/ppp/options); echo "\${PPoE_ID#* }"</input>
   4.452 +			<variable>PPoE_ID</variable>
   4.453 +		</entry>
   4.454 +	</hbox>
   4.455 +	<hbox>
   4.456 +		<text use-markup="true">
   4.457 +			<label>"<b>Password:</b>"</label>
   4.458 +		</text>
   4.459 +		<entry>
   4.460 +			<input>PPoE_PASS=\$(ID=\$(awk '/^name/{print \$2}' /etc/ppp/options) ; \
   4.461 +				awk -v KEY="\$ID" '\$1==KEY{print \$3}' /etc/ppp/pap-secrets); \
   4.462 +				echo "\$PPoE_PASS"</input>
   4.463 +			<variable>PPoE_PASS</variable>
   4.464 +		</entry>
   4.465 +	</hbox>
   4.466 +	<hbox>
   4.467 +$(helpbutton pppd 80x30)
   4.468 +$(manbutton 8 pppd)
   4.469 +$(webbutton ppp)
   4.470 +		<button>
   4.471 +			<input file icon="accessories-text-editor"></input>
   4.472 +			<label>Tune</label>
   4.473 +			<action>[ -n "\$PPoE_ID" ] && sed -i 's/^name .*/name \$PPoE_ID/' /etc/ppp/options</action>
   4.474 +			<action type="lauch">leafpad /etc/ppp/options</action>
   4.475 +		</button>
   4.476 +		<button>
   4.477 +			<label>Start</label>
   4.478 +			<input file icon="forward"></input>
   4.479 +			<action>[ -n "\$PPoE_ID" ] && grep -qs "^\$PPoE_ID" /etc/ppp/pap-secrets \
   4.480 +				|| echo "\$PPoE_ID	*	\$PPoE_PASS" >> /etc/ppp/pap-secrets</action>
   4.481 +			<action>[ -n "\$PPoE_ID" ] && grep -qs "^\$PPoE_ID" /etc/ppp/chap-secrets \
   4.482 +				|| echo "\$PPoE_ID	*	\$PPoE_PASS" >> /etc/ppp/chap-secrets</action> 
   4.483 +			<action>[ -n "\$PPoE_ID" ] && sed -i "s/^name .*/name \$PPoE_ID/" /etc/ppp/options</action>
   4.484 +			<action>killall udhcpc</action>
   4.485 +			<action>sed -i 's/DHCP=.*/DHCP="no"/' /etc/network.conf</action>
   4.486 +			<action>sed -i 's/PPPOE=.*/PPPOE="yes"/' /etc/network.conf</action>
   4.487 +			<action>. /etc/network.conf ; pppd \$INTERFACE &</action>
   4.488 +		</button>
   4.489 +		<button>
   4.490 +			<label>Stop</label>
   4.491 +			<input file icon="stop"></input>
   4.492 +			<action>sed -i 's/PPPOE=.*/PPPOE="no"/' /etc/network.conf</action>
   4.493 +			<action>killall pppd</action>
   4.494 +		</button>
   4.495 +	</hbox>
   4.496 +</frame>
   4.497 +EOT
   4.498 +}
   4.499 +
   4.500 +#
   4.501 +# PPP settings.
   4.502 +#
   4.503 +tab_ppp()
   4.504 +{
   4.505 +cat <<EOT
   4.506 +<frame PPP>
   4.507 +	<hbox>
   4.508 +		<text use-markup="true">
   4.509 +			<label>"<b>Username: </b>"</label>
   4.510 +		</text>
   4.511 +		<entry>
   4.512 +			<input>NAME=\$(grep -s ^ACCOUNT= /etc/ppp/scripts/ppp-on | cut -f1); echo "\${NAME#*=}"</input>
   4.513 +			<variable>NAME</variable>
   4.514 +		</entry>
   4.515 +	</hbox>
   4.516 +	<hbox>
   4.517 +		<text use-markup="true">
   4.518 +			<label>"<b>Password: </b>"</label>
   4.519 +		</text>
   4.520 +		<entry>
   4.521 +			<input>PASS=\$(grep -s ^PASSWORD= /etc/ppp/scripts/ppp-on | cut -f1); echo "\${PASS#*=}"</input>
   4.522 +			<variable>PASS</variable>
   4.523 +		</entry>
   4.524 +	</hbox>
   4.525 +	<hbox>
   4.526 +		<text use-markup="true">
   4.527 +			<label>"<b>Telephone:</b>"</label>
   4.528 +		</text>
   4.529 +		<entry>
   4.530 +			<input>PHONE=\$(grep -s ^TELEPHONE= /etc/ppp/scripts/ppp-on | cut -f1); echo "\${PHONE#*=}"</input>
   4.531 +			<variable>PHONE</variable>
   4.532 +		</entry>
   4.533 +	</hbox>
   4.534 +	<hbox>
   4.535 +$(helpbutton pppd 80x30)
   4.536 +$(manbutton 8 pppd)
   4.537 +$(webbutton ppp)
   4.538 +		<button>
   4.539 +			<input file icon="accessories-text-editor"></input>
   4.540 +			<label>Tune</label>
   4.541 +			<action>[ -n "\$NAME" ] && sed -i "s/^ACCOUNT=.*/ACCOUNT=\$NAME/" /etc/ppp/scripts/ppp-on</action>
   4.542 +			<action>[ -n "\$PASS" ] && sed -i "s/^PASSWORD=.*/PASSWORD=\$PASS/" /etc/ppp/scripts/ppp-on</action>
   4.543 +			<action>[ -n "\$PHONE" ] && sed -i "s/^TELEPHONE=.*/TELEPHONE=\$PHONE/" /etc/ppp/scripts/ppp-on</action>
   4.544 +			<action type="lauch">leafpad /etc/ppp/scripts/ppp-on</action>
   4.545 +		</button>
   4.546 +		<button>
   4.547 +			<label>Start</label>
   4.548 +			<input file icon="forward"></input>
   4.549 +			<action>[ -n "\$NAME" ] && grep -qs "^\$NAME" /etc/ppp/pap-secrets \
   4.550 +				|| echo "\$NAME	*	\$PASS" >> /etc/ppp/pap-secrets</action>
   4.551 +			<action>[ -n "\$NAME" ] && grep -qs "^\$NAME" /etc/ppp/chap-secrets \
   4.552 +				|| echo "\$NAME	*	\$PASS" >> /etc/ppp/chap-secrets</action>
   4.553 +			<action>[ -n "\$NAME" ] && sed -i "s/^name .*/name \$NAME/" /etc/ppp/options</action>
   4.554 +			<action>/etc/ppp/scripts/ppp-off</action>
   4.555 +			<action>/etc/ppp/scripts/ppp-on &</action>
   4.556 +		</button>
   4.557 +		<button>
   4.558 +			<label>Stop</label>
   4.559 +			<input file icon="stop"></input>
   4.560 +			<action>/etc/ppp/scripts/ppp-off</action>
   4.561 +		</button>
   4.562 +	</hbox>
   4.563 +</frame>
   4.564 +EOT
   4.565 +}
   4.566 +
   4.567 +#
   4.568 +# System Wide configuration.
   4.569 +#
   4.570 +tab_system()
   4.571 +{
   4.572 +cat <<EOT
   4.573 +<frame Configuration files>
   4.574 +      <hbox>
   4.575 +        <text use-markup="true">
   4.576 +          <label>"<b>Hosts            :</b>"</label>
   4.577 +        </text>
   4.578 +        <entry editable="false">
   4.579 +          <default>/etc/hosts</default>
   4.580 +          <variable>HOSTS</variable>
   4.581 +        </entry>
   4.582 +$(editbutton \$HOSTS)
   4.583 +      </hbox>
   4.584 +      <hbox>
   4.585 +        <text use-markup="true">
   4.586 +          <label>"<b>Host name    :</b>"</label>
   4.587 +        </text>
   4.588 +        <entry editable="false">
   4.589 +          <default>/etc/hostname</default>
   4.590 +          <variable>HOSTNAME</variable>
   4.591 +        </entry>
   4.592 +$(editbutton \$HOSTNAME)
   4.593 +      </hbox>
   4.594 +      <hbox>
   4.595 +        <text use-markup="true">
   4.596 +          <label>"<b>Network       :</b>"</label>
   4.597 +        </text>
   4.598 +        <entry editable="false">
   4.599 +          <default>/etc/network.conf</default>
   4.600 +          <variable>CONFIG_FILE</variable>
   4.601 +        </entry>
   4.602 +$(editbutton \$CONFIG_FILE)
   4.603 +      </hbox>
   4.604 +      <hbox>
   4.605 +        <button>
   4.606 +          <label>Restart</label>
   4.607 +          <input file icon="reload"></input>
   4.608 +          <action>echo -n "Stopping interface : \$INTERFACE... "</action>
   4.609 +          <action>ifconfig \$INTERFACE down</action>
   4.610 +          <action>killall -q udhcpc; echo "done"</action>
   4.611 +          <action>/etc/init.d/network.sh restart</action>
   4.612 +        </button>
   4.613 +      </hbox>
   4.614 +</frame>
   4.615 +EOT
   4.616 +}
   4.617 +
   4.618 +#
   4.619 +# ssh/ppp
   4.620 +#
   4.621 +tab_sshppp()
   4.622 +{
   4.623 +cat <<EOT
   4.624 +    <frame Virtual Private Network with PPP/SSH>
   4.625 +      <hbox>
   4.626 +        <text use-markup="true">
   4.627 +          <label>"<b>Peer          :</b>"</label>
   4.628 +        </text>
   4.629 +        <entry>
   4.630 +          <variable>DROPBEAR_PEERVPN</variable>
   4.631 +	  <default>user@elsewhere</default>
   4.632 +        </entry>
   4.633 +      </hbox>
   4.634 +      <hbox>
   4.635 +        <text use-markup="true">
   4.636 +          <label>"<b>Local IP     :</b>"</label>
   4.637 +        </text>
   4.638 +        <entry>
   4.639 +          <variable>DROPBEAR_LOCAL</variable>
   4.640 +	  <default>192.168.254.1</default>
   4.641 +        </entry>
   4.642 +      </hbox>
   4.643 +      <hbox>
   4.644 +        <text use-markup="true">
   4.645 +          <label>"<b>Remote IP :</b>"</label>
   4.646 +        </text>
   4.647 +        <entry>
   4.648 +          <variable>DROPBEAR_REMOTE</variable>
   4.649 +	  <default>192.168.254.2</default>
   4.650 +        </entry>
   4.651 +      </hbox>
   4.652 +      <hbox>
   4.653 +        <text use-markup="true">
   4.654 +          <label>"<b>Route(s)    :</b>"</label>
   4.655 +        </text>
   4.656 +        <entry>
   4.657 +          <variable>DROPBEAR_ROUTE</variable>
   4.658 +	  <default>192.168.10.0/24 192.168.20.0/28</default>
   4.659 +        </entry>
   4.660 +      </hbox>
   4.661 +      <hbox>
   4.662 +$(wikibutton http://doc.slitaz.org/en:guides:vpn)
   4.663 +        <button>
   4.664 +          <input file icon="forward"></input>
   4.665 +	  <label>Connect</label>
   4.666 +	  <action>$0 call vpnssh \$DROPBEAR_PEERVPN \$DROPBEAR_LOCAL \$DROPBEAR_REMOTE "\$DROPBEAR_ROUTE" &</action>
   4.667 +        </button>
   4.668 +        <button>
   4.669 +          <input file icon="stop"></input>
   4.670 +	  <label>Disconnect</label>
   4.671 +	  <action>$0 call killvpnssh</action>
   4.672 +        </button>
   4.673 +        <button>
   4.674 +          <input file icon="go-up"></input>
   4.675 +	  <label>Send key</label>
   4.676 +	  <action>$xterm -geometry 80x10 -title "Send key" -e "$0 call sendsshkey \$DROPBEAR_PEERVPN; echo -e \"----\nENTER to continue...\" && read close"</action>
   4.677 +        </button>
   4.678 +      </hbox>
   4.679 +    </frame>
   4.680 +EOT
   4.681 +}
   4.682 +
   4.683 +#
   4.684 +# PPTP client
   4.685 +#
   4.686 +#FIXME
   4.687 +#cat > /etc/ppp/peers/$TUNNEL <<EOT
   4.688 +#pty "pptp $SERVER --nolaunchpppd"
   4.689 +#lock
   4.690 +#noauth
   4.691 +#nobsdcomp
   4.692 +#nodeflate
   4.693 +#name $DOMAIN\\$USERNAME
   4.694 +#remotename $TUNNEL
   4.695 +#ipparam $TUNNEL
   4.696 +#$(encryption && echo "require-mppe-128")
   4.697 +#EOT
   4.698 +#pppd call $TUNNEL updetach
   4.699 +
   4.700 +tab_pptp()
   4.701 +{
   4.702 +[ -f /etc/ppp/options.pptp ] || cat >> /etc/ppp/options.pptp <<EOT
   4.703 +lock noauth nobsdcomp nodeflate remotename PPTP
   4.704 +EOT
   4.705 +[ -f /etc/ppp/pptp-servers ] || cat >> /etc/ppp/pptp-servers <<EOT
   4.706 +# PPTP servers list
   4.707 +EOT
   4.708 +cat <<EOT
   4.709 +    <frame Virtual Private Network with PPTP>
   4.710 +      <hbox>
   4.711 +        <text use-markup="true">
   4.712 +          <label>"<b>Server:</b>"</label>
   4.713 +        </text>
   4.714 +        <combobox>
   4.715 +          <variable>PPTP_SERVER</variable>
   4.716 +EOT
   4.717 +grep -v ^\# /etc/ppp/pptp-servers | \
   4.718 +awk '{ printf "          <item>%s</item>\n",$1 }'
   4.719 +cat <<EOT
   4.720 +          <item>SERVER</item>
   4.721 +        </combobox>
   4.722 +$(editbutton /etc/ppp/pptp-servers)
   4.723 +      </hbox>
   4.724 +      <hbox>
   4.725 +        <text use-markup="true">
   4.726 +          <label>"<b>   User:</b>"</label>
   4.727 +        </text>
   4.728 +        <combobox>
   4.729 +          <variable>PPTP_USER</variable>
   4.730 +EOT
   4.731 +grep '\\' /etc/ppp/chap-secrets | grep -v ^\# | \
   4.732 +awk '{ printf "          <item>%s</item>\n",$1 }'
   4.733 +cat <<EOT
   4.734 +          <item>DOMAIN\USERNAME</item>
   4.735 +        </combobox>
   4.736 +$(editbutton /etc/ppp/chap-secrets)
   4.737 +      </hbox>
   4.738 +      <hbox>
   4.739 +        <text use-markup="true">
   4.740 +          <label>"<b>Password:</b>"</label>
   4.741 +        </text>
   4.742 +        <entry>
   4.743 +          <variable>PPTP_PASS</variable>
   4.744 +        </entry>
   4.745 +      </hbox>
   4.746 +      <hbox>
   4.747 +      	<checkbox>
   4.748 +	  <label>Encryption</label>
   4.749 +	  <variable>PPTP_ENC</variable>
   4.750 +	  <default>true</default>
   4.751 +      	</checkbox>
   4.752 +$(helpbutton pptp 80x35)
   4.753 +	<button>
   4.754 +	  <input file icon="accessories-text-editor"></input>
   4.755 +	  <label>Options</label>
   4.756 +	  <action type="lauch">leafpad /etc/ppp/options.pptp</action>
   4.757 +	</button>
   4.758 +$(webbutton pptpclient)
   4.759 +        <button>
   4.760 +          <input file icon="forward"></input>
   4.761 +	  <label>Connect</label>
   4.762 +	  <action>grep -qs ^\$PPTP_USER /etc/ppp/chap-secrets || \
   4.763 +echo "\$PPTP_USER PPTP \"$PPTP_PASS\" *" >> /etc/ppp/chap-secrets</action>
   4.764 +	  <action>grep -qs ^\$PPTP_SERVER /etc/ppp/pptp-servers || \
   4.765 +echo "\$PPTP_SERVER" >> /etc/ppp/pptp-servers</action>
   4.766 +	  <action>PASS=""; [ -n "\$PPTP_PASS" ] && PASS="password \$PASS"; \
   4.767 +ENC=""; [ x\$PPTP_ENC == xtrue ] && ENC="require-mppe-128"; \
   4.768 +/usr/sbin/pptp \$PPTP_SERVER file /etc/ppp/options.pptp \$ENC user \$PPTP_USER \$PASS &
   4.769 +	  </action>
   4.770 +        </button>
   4.771 +        <button>
   4.772 +          <input file icon="stop"></input>
   4.773 +	  <label>Disconnect</label>
   4.774 +	  <action>killall pptp</action>
   4.775 +        </button>
   4.776 +      </hbox>
   4.777 +    </frame>
   4.778 +EOT
   4.779 +}
   4.780 +
   4.781 +#
   4.782 +# Cisco EasyVPN
   4.783 +#
   4.784 +tab_easyvpn()
   4.785 +{
   4.786 +cat <<EOT
   4.787 +    <frame Cisco EasyVPN>
   4.788 +<hbox>
   4.789 +	<text use-markup="true">
   4.790 +		<label>"<b>VPNC_OPTIONS</b>"</label>
   4.791 +	</text>
   4.792 +	<entry editable="false">
   4.793 +EOT
   4.794 +[ -n "$VPNC_OPTIONS" ] && cat << EOT
   4.795 +		<default>$tmp</default>
   4.796 +EOT
   4.797 +	cat << EOT
   4.798 +		<variable>VPNC_OPTS</variable>
   4.799 +	</entry>
   4.800 +$(helpbutton vpnc 80x30)
   4.801 +<button>
   4.802 +	<input file icon="help"></input>
   4.803 +	<label>more</label>
   4.804 +	<action>$xterm -geometry 80x40 -title "vpnc help (q to quit)" -e "$(which vpnc) --long-help 2>&1 | less"</action>
   4.805 +</button>
   4.806 +$(editbutton /etc/daemons.conf)
   4.807 +</hbox>
   4.808 +$(configfile /etc/vpnc/default.conf VPNC_CONF)
   4.809 +$(datafile "/etc/vpnc/vpnc-script" VPNC_SCRIPT 'Script:')
   4.810 +      <hbox>
   4.811 +	$(startstopdaemon vpnc)
   4.812 +      </hbox>
   4.813 +     </frame>
   4.814 +EOT
   4.815 +}
   4.816 +
   4.817 +#
   4.818 +# OpenVPN
   4.819 +#
   4.820 +tab_openvpn()
   4.821 +{
   4.822 +local i
   4.823 +local n
   4.824 +cat <<EOT
   4.825 +<frame OpenVPN>
   4.826 +EOT
   4.827 +n=1
   4.828 +for i in /etc/openvpn/*.conf ; do
   4.829 +	[ -f $i ] || continue
   4.830 +	configfile $i OPENVPN_CONF$n
   4.831 +	n=$(($n + 1))
   4.832 +done
   4.833 +cat <<EOT
   4.834 +      <hbox>
   4.835 +	$(helpbutton openvpn 80x40)
   4.836 +	$(startstopdaemon openvpn)
   4.837 +      </hbox>
   4.838 +</frame>
   4.839 +EOT
   4.840 +}
   4.841 +
   4.842 +data_vpn()
   4.843 +{
   4.844 +cat <<EOT
   4.845 +$([ -x /usr/sbin/dropbear -o -x /usr/sbin/sshd ] && echo "pppd" ||
   4.846 +echo "#")   PPP/SSH       tab_sshppp
   4.847 +pptp        PPTP          tab_pptp
   4.848 +vpnc        EasyVPN       tab_easyvpn
   4.849 +openvpn     OpenVPN       tab_openvpn
   4.850 +EOT
   4.851 +}
   4.852 +
   4.853 +#
   4.854 +# VPN
   4.855 +#
   4.856 +tab_vpn()
   4.857 +{
   4.858 +use_tab data_vpn
   4.859 +}
   4.860 +
   4.861 +#
   4.862 +# ether-wake
   4.863 +#
   4.864 +tab_etherwake()
   4.865 +{
   4.866 +cat <<EOT
   4.867 +    <frame Ether-wake (busybox)>
   4.868 +    <hbox>
   4.869 +      <text use-markup="true">
   4.870 +        <label>"<b>Machines :</b>"</label>
   4.871 +      </text>
   4.872 +      <entry editable="false">
   4.873 +        <default>/etc/ethers</default>
   4.874 +        <variable>ETHERS</variable>
   4.875 +      </entry>
   4.876 +      <button>
   4.877 +        <input file icon="accessories-text-editor"></input>
   4.878 +        <action>[ -s \$ETHERS ] || echo "#00:01:02:03:04:05 mystation" >\$ETHERS</action>
   4.879 +        <action type="lauch">leafpad \$ETHERS</action>
   4.880 +      </button>
   4.881 +    </hbox>
   4.882 +    <hbox>
   4.883 +      <text use-markup="true">
   4.884 +        <label>"<b>Options : </b>"</label>
   4.885 +      </text>
   4.886 +      <entry editable="true">
   4.887 +        <variable>ETHERWAKE_OPTS</variable>
   4.888 +      </entry>
   4.889 +$(helpbutton ether-wake 80x15)
   4.890 +	<button>
   4.891 +		<label>Start</label>
   4.892 +		<input file icon="forward"></input>
   4.893 +		<action>ether-wake \$ETHERWAKE_OPTS</action>
   4.894 +	</button>
   4.895 +    </hbox>
   4.896 +    <frame>
   4.897 +    <hbox>
   4.898 +EOT
   4.899 +if which ethtool > /dev/null; then
   4.900 +cat <<EOT
   4.901 +        <text use-markup="true">
   4.902 +          <label>"<b>Interface:</b>"</label>
   4.903 +        </text>
   4.904 +        <combobox>
   4.905 +          <variable>ETHERWAKE_ETH</variable>
   4.906 +EOT
   4.907 +(cd /sys/class/net ; [ -d eth0 ] && ls -d eth* ) | \
   4.908 +awk '{ printf "          <item>%s</item>\n",$1 }'
   4.909 +cat <<EOT
   4.910 +        </combobox>
   4.911 +	<button>
   4.912 +		<label>Enable Wake On LAN</label>
   4.913 +		<input file icon="forward"></input>
   4.914 +		<action>ethtool -s \$ETHERWAKE_ETH wok g</action>
   4.915 +	</button>
   4.916 +EOT
   4.917 +else
   4.918 +cat <<EOT
   4.919 +    <vbox>
   4.920 +	<text wrap="true" width-chars="58">
   4.921 +			<label>
   4.922 +"Ethtool can enable the Wake-on-lan 
   4.923 +feature on many Ethernet cards.
   4.924 +"
   4.925 +			</label>
   4.926 +	</text>
   4.927 +$(installbox ethtool)
   4.928 +    </vbox>
   4.929 +EOT
   4.930 +fi
   4.931 +cat <<EOT
   4.932 +    </hbox>
   4.933 +    </frame>
   4.934 +    </frame>
   4.935 +EOT
   4.936 +}
   4.937 +
   4.938 +data_main()
   4.939 +{
   4.940 +cat <<EOT
   4.941 +#program    tab name      function
   4.942 +ifconfig    Connections   tab_connections
   4.943 +udhcpc      DHCP          tab_udhcpc
   4.944 +ifconfig    Static\ IP    tab_fixed_ip
   4.945 +pppoe       PPPoE         tab_pppoe
   4.946 +pppd        PPP           tab_ppp
   4.947 +true        VPN           tab_vpn
   4.948 +ether-wake  Etherwake     tab_etherwake
   4.949 +true        Configuration tab_system
   4.950 +EOT
   4.951 +}
   4.952 +
   4.953 +tab_main()
   4.954 +{
   4.955 +use_tab data_main
   4.956 +}
   4.957 +
   4.958 +######################################################
   4.959 +#
   4.960 +# Netbox GUI
   4.961 +#
   4.962 +######################################################
   4.963 +
   4.964 +# English/French help dialog.
   4.965 +export HELP='
   4.966 +<window title="Network status" icon-name="network-wire">
   4.967 +<vbox>
   4.968 +	<text use-markup="true">
   4.969 +		<label>
   4.970 +"
   4.971 +<b>SliTaz - Netbox</b>"
   4.972 +		</label>
   4.973 +	</text>
   4.974 +	<frame English>
   4.975 +		<text wrap="true" width-chars="58">
   4.976 +			<label>
   4.977 +"Netbox lets you manage network connections by getting a dynamic IP by 
   4.978 +DHCP or a static IP and setup servers. Netbox can start or stop
   4.979 +networking, configure network interfaces or directly edit files."
   4.980 +			</label>
   4.981 +		</text>
   4.982 +	</frame>
   4.983 +	<frame Francais>
   4.984 +		<text wrap="true" width-chars="58">
   4.985 +			<label>
   4.986 +"Netbox vous permet de gerer les connexions reseau avec une IP
   4.987 +statique ou en obtenant une IP dynamique par DHCP, et de parametrer
   4.988 +les serveurs. Netbox peut demarrer ou arreter le reseau, configurer
   4.989 +les interfaces reseau ou editer directement les fichiers."
   4.990 +			</label>
   4.991 +		</text>
   4.992 +	</frame>
   4.993 +</vbox>
   4.994 +</window>
   4.995 +'
   4.996 +
   4.997 +# Interface status with ifconfig without arguments to show all
   4.998 +# active connections.
   4.999 +#
  4.1000 +export IFCONFIG="
  4.1001 +<window title=\"Network status\" icon-name=\"network-wire\">
  4.1002 +<vbox>
  4.1003 +$(tab_status)
  4.1004 +	<hbox>
  4.1005 +		<button>
  4.1006 +			<input file icon=\"gtk-close\"></input>
  4.1007 +			<action type=\"closewindow\">IFCONFIG</action>
  4.1008 +		</button>
  4.1009 +	</hbox>
  4.1010 +</vbox>
  4.1011 +</window>"
  4.1012 +
  4.1013 +# The main dialog with notebook, start/stop buttons and all options.
  4.1014 +# Note that /etc/network.conf is seded when an interface is activated.
  4.1015 +#
  4.1016 +head='
  4.1017 +<window title="SliTaz Netbox Manager" icon-name="network-wired">
  4.1018 +	<vbox>
  4.1019 +
  4.1020 +		<hbox>
  4.1021 +			<text use-markup="true">
  4.1022 +				<label>"<b>Network Manager</b>"</label>
  4.1023 +			</text>
  4.1024 +			<pixmap>
  4.1025 +				<input file>/usr/share/pixmaps/netbox.png</input>
  4.1026 +			</pixmap>
  4.1027 +		</hbox>
  4.1028 +'
  4.1029 +bottom='
  4.1030 +		<hbox>
  4.1031 +			<button>
  4.1032 +				<label>Wireless manager</label>
  4.1033 +				<input file icon="network-wireless"></input>
  4.1034 +				<action>wifibox &</action>
  4.1035 +			</button>
  4.1036 +			<button>
  4.1037 +				<label>Refresh list</label>
  4.1038 +				<input file icon="reload"></input>
  4.1039 +				<action>refresh:INTERFACE_LIST</action>
  4.1040 +			</button>
  4.1041 +			<button>
  4.1042 +			<label>Full status</label>
  4.1043 +				<input file icon="dialog-information"></input>
  4.1044 +				<action type="launch">IFCONFIG</action>
  4.1045 +			</button>
  4.1046 +			<button help>
  4.1047 +				<label>Help</label>
  4.1048 +				<action type="launch">HELP</action>
  4.1049 +			</button>
  4.1050 +			<button>
  4.1051 +				<label>Quit</label>
  4.1052 +				<input file icon="exit"></input>
  4.1053 +				<action type="exit">Exit</action>
  4.1054 +			</button>
  4.1055 +		</hbox>
  4.1056 +
  4.1057 +	</vbox>
  4.1058 +</window>
  4.1059 +'
  4.1060 +
  4.1061 +NET_BOX="${head}$(tab_main)${bottom}"
  4.1062 +
  4.1063 +export NET_BOX
  4.1064 +
  4.1065 +# TODO:  Modules(Network kernel modules)
  4.1066 +
  4.1067 +# Only root can configure network.
  4.1068 +check_root
  4.1069 +
  4.1070 +# Configure and connect if button Connect was pressed.
  4.1071 +if ! grep -qs ^name /etc/ppp/options ; then
  4.1072 +	# Generate /etc/ppp/options
  4.1073 +	cat > /etc/ppp/options << _EOT_
  4.1074 +plugin rp-pppoe.so
  4.1075 +name provider-ID
  4.1076 +noipdefault
  4.1077 +defaultroute
  4.1078 +mtu 1492
  4.1079 +mru 1492
  4.1080 +lock
  4.1081 +_EOT_
  4.1082 +	# Generate /etc/ppp/pap-secrets
  4.1083 +	cat > /etc/ppp/pap-secrets << _EOT_
  4.1084 +# Secrets for authentication using PAP
  4.1085 +# client	server	secret			IP addresses
  4.1086 +_EOT_
  4.1087 +	# Generate /etc/ppp/chap-secrets
  4.1088 +	cat > /etc/ppp/chap-secrets << _EOT_
  4.1089 +# Secrets for authentication using CHAP
  4.1090 +# client	server	secret			IP addresses
  4.1091 +_EOT_
  4.1092 +fi
  4.1093 +gtkdialog --center --program=NET_BOX | grep -a 'EXIT="restart"' && continue
  4.1094 +exit 0
  4.1095 +done
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/oldstuff/gtkdialog/netbox.desktop	Sat Apr 28 20:21:10 2012 +0200
     5.3 @@ -0,0 +1,10 @@
     5.4 +[Desktop Entry]
     5.5 +Encoding=UTF-8
     5.6 +Name=Configure networking
     5.7 +Name[fr]=Configurer le réseau
     5.8 +Name[pt]=Configuração de Rede
     5.9 +Name[pt_BR]=Configuração de Rede
    5.10 +Exec=subox netbox
    5.11 +Icon=netbox
    5.12 +Type=Application
    5.13 +Categories=System;Application;
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/oldstuff/gtkdialog/scpbox	Sat Apr 28 20:21:10 2012 +0200
     6.3 @@ -0,0 +1,104 @@
     6.4 +#!/bin/sh
     6.5 +# 
     6.6 +# Gtkdialog box interface for secure file transfer with scp from Dropbear.
     6.7 +# - SliTaz GNU/Linux 2008-2010.
     6.8 +#
     6.9 +VERSION=20100314
    6.10 +
    6.11 +# Internationalization
    6.12 +. /usr/bin/gettext.sh
    6.13 +TEXTDOMAIN='slitaz-boxes'
    6.14 +export TEXTDOMAIN
    6.15 +
    6.16 +# Box
    6.17 +export SCP_DIALOG='
    6.18 +<window title="Scpbox" icon-name="folder-remote">
    6.19 +<vbox>
    6.20 +
    6.21 +	<text use-markup="true">
    6.22 +		<label>"
    6.23 +<b>SliTaz - Scpbox</b>"
    6.24 +		</label>
    6.25 +	</text>
    6.26 +	<text wrap="true" width-chars="52" use-markup="true">
    6.27 +		<label>"'`gettext "
    6.28 +Copy files securely with scp from Dropbear SSH client/server.
    6.29 +		"`'"</label>
    6.30 +	</text>
    6.31 +	
    6.32 +	<frame '`gettext "Configuration"`'>
    6.33 +		<hbox>
    6.34 +			<text use-markup="true">
    6.35 +				<label>"'`gettext "<b>User        :</b>"`'"</label>
    6.36 +			</text>
    6.37 +			<entry>
    6.38 +				<variable>USER</variable>
    6.39 +			</entry>
    6.40 +		</hbox>
    6.41 +		<hbox>
    6.42 +			<text use-markup="true">
    6.43 +				<label>"'`gettext "<b>Host        :</b>"`'"</label>
    6.44 +			</text>
    6.45 +			<entry>
    6.46 +				<variable>HOST</variable>
    6.47 +			</entry>
    6.48 +		</hbox>
    6.49 +		<hbox>
    6.50 +			<text use-markup="true">
    6.51 +				<label>"'`gettext "<b>Options  :</b>"`'"</label>
    6.52 +			</text>
    6.53 +			<entry>
    6.54 +				<default>-r -P 22</default>
    6.55 +				<variable>SCP_OPTS</variable>
    6.56 +			</entry>
    6.57 +		</hbox>
    6.58 +	</frame>
    6.59 +	
    6.60 +	<frame '`gettext "Paths"`'>
    6.61 +		<hbox>
    6.62 +			<text use-markup="true">
    6.63 +				<label>"'`gettext "<b>Local       :</b>"`'"</label>
    6.64 +			</text>
    6.65 +			<entry>
    6.66 +				<input>echo $HOME</input>
    6.67 +				<variable>LOCAL_PATH</variable>
    6.68 +			</entry>
    6.69 +			<button>
    6.70 +				<input file icon="gtk-open"></input>
    6.71 +				<action type="fileselect">LOCAL_PATH</action>
    6.72 +			</button>
    6.73 +		</hbox>
    6.74 +		<hbox>
    6.75 +			<text use-markup="true">
    6.76 +				<label>"'`gettext "<b>Remote   :</b>"`'"</label>
    6.77 +			</text>
    6.78 +			<entry>
    6.79 +				<variable>REMOTE_PATH</variable>
    6.80 +			</entry>
    6.81 +		</hbox>
    6.82 +	</frame>
    6.83 +	
    6.84 +	<hbox>
    6.85 +		<button>
    6.86 +			<label>'`gettext "Download"`'</label>
    6.87 +			<input file icon="down"></input>
    6.88 +			<action>xterm -geometry 80x16 -e scp $SCP_OPTS $USER@$HOST:$REMOTE_PATH $LOCAL_PATH</action>
    6.89 +		</button>
    6.90 +		<button>
    6.91 +			<label>'`gettext "Upload"`'</label>
    6.92 +			<input file icon="up"></input>
    6.93 +			<action>xterm -geometry 80x16 -e scp $SCP_OPTS $LOCAL_PATH $USER@$HOST:$REMOTE_PATH</action>
    6.94 +		</button>
    6.95 +		<button>
    6.96 +			<label>'`gettext "Exit"`'</label>
    6.97 +			<input file icon="exit"></input>
    6.98 +			<action type="exit">Exit</action>
    6.99 +		</button>
   6.100 +	</hbox>
   6.101 +
   6.102 +</vbox>
   6.103 +</window>'
   6.104 + 
   6.105 +gtkdialog --program=SCP_DIALOG >/dev/null
   6.106 +
   6.107 +exit 0
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/oldstuff/gtkdialog/scpbox.desktop	Sat Apr 28 20:21:10 2012 +0200
     7.3 @@ -0,0 +1,10 @@
     7.4 +[Desktop Entry]
     7.5 +Encoding=UTF-8
     7.6 +Name=Scpbox Secure copy
     7.7 +Name[fr]=Copie sécurisée Scpbox
     7.8 +Name[pt]=Scpbox Cópia Segura de Arquivos
     7.9 +Name[pt_BR]=Scpbox Cópia Segura de Arquivos
    7.10 +Exec=scpbox
    7.11 +Icon=folder-remote
    7.12 +Type=Application
    7.13 +Categories=Application;Network;
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/oldstuff/gtkdialog/serverbox	Sat Apr 28 20:21:10 2012 +0200
     8.3 @@ -0,0 +1,1144 @@
     8.4 +#!/bin/sh
     8.5 +#
     8.6 +# Gtkdialog box to manage servers.
     8.7 +# Please use tab to indent.
     8.8 +
     8.9 +VERSION=20100315
    8.10 +
    8.11 +. /usr/lib/slitaz/gui_functions
    8.12 +
    8.13 +# Check if user is root.
    8.14 +check_root()
    8.15 +{
    8.16 +	if test $(id -u) != 0 ; then
    8.17 +		echo -e "
    8.18 +You must be root to run `basename $0`. Please type 'su' and
    8.19 +root password to become super-user.\n"
    8.20 +		exit 0
    8.21 +	fi
    8.22 +}
    8.23 +#
    8.24 +# Status servers
    8.25 +#
    8.26 +tab_status_servers()
    8.27 +{
    8.28 +local servers
    8.29 +servers="dropbear sshd inetd dhcpd dnsd named rsync httpd mbd vnc pppd \
    8.30 +knock postfix fetchmail cyrus perdition slapd sql squid slim cron ntp nfsd \
    8.31 +ftpd cups"
    8.32 +cat <<EOT
    8.33 +<tree>
    8.34 +	<label>Server processes</label>
    8.35 +	<input>for i in $servers; do ps ww | grep \$i | grep -v grep; done</input>
    8.36 +</tree>
    8.37 +EOT
    8.38 +}
    8.39 +
    8.40 +data_status()
    8.41 +{
    8.42 +cat <<EOT
    8.43 +ps          Servers               tab_status_servers
    8.44 +EOT
    8.45 +}
    8.46 +
    8.47 +#
    8.48 +# Status
    8.49 +#
    8.50 +tab_status()
    8.51 +{
    8.52 +use_tab data_status
    8.53 +}
    8.54 +
    8.55 +sshremote()
    8.56 +{
    8.57 +	cat << EOT
    8.58 +      <hbox>
    8.59 +        <text use-markup="true">
    8.60 +          <label>"<b>Remote  :</b>"</label>
    8.61 +        </text>
    8.62 +        <entry>
    8.63 +          <variable>$2</variable>
    8.64 +	  <default>user@elsewhere</default>
    8.65 +        </entry>
    8.66 +        <button>
    8.67 +          <input file icon="utilities-terminal"></input>
    8.68 +	  <label>Connect</label>
    8.69 +	  <action>xterm -fa MiscFixed -fs 11 -bg black -fg white -geometry 80x25 -title "$1" -e "$1 \$$2 ; echo -e \"----\nENTER to continue...\" && read close" &</action>
    8.70 +        </button>
    8.71 +        <button>
    8.72 +          <input file icon="go-up"></input>
    8.73 +	  <label>Send key</label>
    8.74 +	  <action>$xterm -geometry 80x10 -title "send ssh key" -e "$0 call sendsshkey \$$2; echo -e \"----\nENTER to continue...\" && read close"</action>
    8.75 +        </button>
    8.76 +      </hbox>
    8.77 +EOT
    8.78 +}
    8.79 +#
    8.80 +# Dropbear client & server
    8.81 +#
    8.82 +tab_dropbear()
    8.83 +{
    8.84 +. /etc/daemons.conf
    8.85 +set -- $DROPBEAR_OPTIONS
    8.86 +while [ -n "$2" ]; do
    8.87 +  [ "$1" = "-b" ] && DROPBEAR_BANNER="$2" && break
    8.88 +  shift
    8.89 +done
    8.90 +
    8.91 +cat <<EOT
    8.92 +     <frame Dropbear>
    8.93 +$(helpdaemon dropbear 80x35 DROPBEAR_OPTIONS DROPBEAR_OPTS)
    8.94 +$(datafile /etc/dropbear/banner DROPBEAR_BANNER 'Banner   :')
    8.95 +$(sshremote DROPBEAR_PEER 'dbclient -i /etc/dropbear/dropbear_rsa_host_key')
    8.96 +      <hbox>
    8.97 +	$(startstopdaemon dropbear)
    8.98 +      </hbox>
    8.99 +     </frame>
   8.100 +EOT
   8.101 +}
   8.102 +
   8.103 +#
   8.104 +# OpenSSH client & server
   8.105 +#
   8.106 +tab_openssh()
   8.107 +{
   8.108 +cat <<EOT
   8.109 +    <frame OpenSSH>
   8.110 +$(helpdaemon sshd 80x30 OPENSSH_OPTIONS OPENSSH_OPTS 8 nohelp)
   8.111 +$(configfile /etc/ssh/sshd_config OPENSSH_CONF '5 sshd_config')
   8.112 +$(sshremote OPENSSH_PEER 'ssh -i /etc/ssh/ssh_host_rsa_key')
   8.113 +      <hbox>
   8.114 +	$(startstopdaemon openssh)
   8.115 +      </hbox>
   8.116 +     </frame>
   8.117 +EOT
   8.118 +}
   8.119 +
   8.120 +data_sshd()
   8.121 +{
   8.122 +cat <<EOT
   8.123 +dropbear    Dropbear      tab_dropbear
   8.124 +sshd        OpenSSH       tab_openssh
   8.125 +EOT
   8.126 +}
   8.127 +
   8.128 +#
   8.129 +# SSH tab
   8.130 +#
   8.131 +tab_sshd()
   8.132 +{
   8.133 +use_tab data_sshd
   8.134 +}
   8.135 +
   8.136 +#
   8.137 +# Busybox Inetd
   8.138 +#
   8.139 +tab_inetd()
   8.140 +{
   8.141 +cat <<EOT
   8.142 +<frame Inetd (busybox)>
   8.143 +$(helpdaemon inetd 60x20 INETD_OPTIONS INETD_OPTS)
   8.144 +$(configfile /etc/inetd.conf INETD_CONF)
   8.145 +      <hbox>
   8.146 +EOT
   8.147 +for i in $(grep bin /etc/inetd.conf | awk '{ print $6}'); do
   8.148 +  i=$(basename $i)
   8.149 +  helpbutton $i 60x24 $i
   8.150 +done
   8.151 +cat <<EOT
   8.152 +	$(startstopdaemon inetd)
   8.153 +      </hbox>
   8.154 +     </frame>
   8.155 +EOT
   8.156 +}
   8.157 +
   8.158 +#
   8.159 +# ZeroConf
   8.160 +#
   8.161 +tab_zcip()
   8.162 +{
   8.163 +	
   8.164 +	. /etc/daemons.conf
   8.165 +if [ -x /sbin/zcip -a -z "$ZCIP_OPTIONS" ]; then
   8.166 +	ZCIP_OPTIONS="eth0 /etc/zcip.script"
   8.167 +	cat >> /etc/daemons.conf <<EOT
   8.168 +# ZeroConf options
   8.169 +ZCIP_OPTIONS="$ZCIP_OPTIONS"
   8.170 +
   8.171 +EOT
   8.172 +fi
   8.173 +cat <<EOT
   8.174 +     <frame Zcip (busybox)>
   8.175 +$(helpdaemon zcip 60x20 ZCIP_OPTIONS ZCIP_OPTS)
   8.176 +$(datafile /etc/zcip.script CZIP_SCRIPT 'Script :')
   8.177 +      <hbox>
   8.178 +	$(startstopdaemon zcip)
   8.179 +      </hbox>
   8.180 +     </frame>
   8.181 +EOT
   8.182 +}
   8.183 +
   8.184 +#
   8.185 +# Dhcpd ISC
   8.186 +#
   8.187 +tab_isc_dhcpd()
   8.188 +{
   8.189 +cat <<EOT
   8.190 +    <frame Dhcpd (ISC)>
   8.191 +$(helpdaemon dhcpd 60x14 DHCPD_OPTIONS DHCPD_OPTS)
   8.192 +$(configfile /etc/dhcpd.conf DHCPD_CONF)
   8.193 +      <hbox>
   8.194 +	$(startstopdaemon dhcpd dhcp)
   8.195 +      </hbox>
   8.196 +     </frame>
   8.197 +EOT
   8.198 +}
   8.199 +
   8.200 +#
   8.201 +# Dhcpd Busybox
   8.202 +#
   8.203 +tab_udhcpd()
   8.204 +{
   8.205 +cat <<EOT
   8.206 +    <frame Udhcpd (busybox)>
   8.207 +$(helpdaemon udhcpd 60x18 UDHCPD_OPTIONS UDHCPD_OPTS)
   8.208 +$(configfile /etc/udhcpd.conf UDHCPD_CONF)
   8.209 +      <hbox>
   8.210 +	$(startstopdaemon udhcpd busybox)
   8.211 +      </hbox>
   8.212 +     </frame>
   8.213 +EOT
   8.214 +}
   8.215 +
   8.216 +data_dhcpd()
   8.217 +{
   8.218 +cat <<EOT
   8.219 +udhcpd      Udhcpd        tab_udhcpd
   8.220 +dhcpd       Dhcpd         tab_isc_dhcpd
   8.221 +dnsmasq     DNSmasq       tab_dnsmasq
   8.222 +EOT
   8.223 +}
   8.224 +
   8.225 +#
   8.226 +# dhcpd tab
   8.227 +#
   8.228 +tab_dhcpd()
   8.229 +{
   8.230 +use_tab data_dhcpd
   8.231 +}
   8.232 +
   8.233 +#
   8.234 +# PXE forwarder
   8.235 +#
   8.236 +tab_gpxe()
   8.237 +{
   8.238 +cat <<EOT
   8.239 +<frame PXE forwarder>
   8.240 +      <hbox>
   8.241 +        <text use-markup="true">
   8.242 +          <label>"<b>WEB boot URL(s) :</b>"</label>
   8.243 +        </text>
   8.244 +      </hbox>
   8.245 +      <hbox>
   8.246 +        <entry editable="true">
   8.247 +          <default>
   8.248 +"$(dd bs=1 skip=5 count=255 if=/usr/share/boot/gpxe.pxe 2> /dev/null | strings)"
   8.249 +          </default>
   8.250 +          <variable>WEB_PXE</variable>
   8.251 +        </entry>
   8.252 +      </hbox>
   8.253 +      <hbox>
   8.254 +$(wikibutton http://doc.slitaz.org/en:guides:pxe)
   8.255 +        <button>
   8.256 +          <input file icon="go-jump"></input>
   8.257 +	  <label>Install</label>
   8.258 +	  <action>
   8.259 +	echo -n "\$WEB_PXE" | cat - /dev/zero | \
   8.260 +	dd conv=notrunc bs=1 seek=5 count=255 of=/usr/share/boot/gpxe.pxe
   8.261 +	  </action>
   8.262 +	  <action>
   8.263 +	sed -i "s|tftpd -r .*\$|tftpd -r /usr/share/boot|" /etc/inetd.conf
   8.264 +	  </action>
   8.265 +	  <action> sed -i "/^boot_file/d" \$UDHCPD_CONF </action>
   8.266 +	  <action> echo "boot_file gpxe.pxe" >> \$UDHCPD_CONF </action>
   8.267 +	  <action> /etc/init.d/inetd restart </action>
   8.268 +	  <action> /etc/init.d/udhcpd restart </action>
   8.269 +	<action>sed -i "s/RUN_DAEMONS=\\"\\(.*\\)inetd \?\\(.*\\)\\"/RUN_DAEMONS=\\"\1\2\\"/" /etc/rcS.conf</action>
   8.270 +	<action>sed -i "s/RUN_DAEMONS=\\"\\(.*\\)udhcpd \?\\(.*\\)\\"/RUN_DAEMONS=\\"\1\2\\"/" /etc/rcS.conf</action>
   8.271 +	<action>sed -i "s/RUN_DAEMONS=\\"\\(.*\\)\\"/RUN_DAEMONS=\\"udhcpd inetd \1\\"/" /etc/rcS.conf</action>
   8.272 +        </button>
   8.273 +      </hbox>
   8.274 +</frame>
   8.275 +EOT
   8.276 +}
   8.277 +
   8.278 +#
   8.279 +# PXE server
   8.280 +#
   8.281 +tab_pxelinux()
   8.282 +{
   8.283 +cat <<EOT
   8.284 +<frame PXElinux>
   8.285 +      <hbox>
   8.286 +        <text wrap="true">
   8.287 +          <label>
   8.288 +"Launch Dhcpd and Inetd with Tftpd to start the PXE service."
   8.289 +          </label>
   8.290 +        </text>
   8.291 +      </hbox>
   8.292 +      <hbox>
   8.293 +        <text use-markup="true">
   8.294 +          <label>"<b>Configuration :</b>"</label>
   8.295 +        </text>
   8.296 +        <entry editable="false">
   8.297 +          <default>
   8.298 +$(grep bin/tftpd /etc/inetd.conf | awk '{ print $NF }')/pxelinux.cfg/default
   8.299 +          </default>
   8.300 +          <variable>PXE_CONF</variable>
   8.301 +        </entry>
   8.302 +        <button>
   8.303 +          <input file icon="accessories-text-editor"></input>
   8.304 +	  <action>dir=\$(dirname \$PXE_CONF); [ -d \$dir ] || mkdir -p \$dir</action>
   8.305 +	  <action>lzma d /usr/share/boot/pxelinux.0.lzma \$(dirname \$PXE_CONF)/../pxelinux.0</action>
   8.306 +	  <action>sed -i "/^boot_file/d" \$UDHCPD_CONF</action>
   8.307 +	  <action>echo "boot_file pxelinux.0" >> \$UDHCPD_CONF</action>
   8.308 +	  <action>grep -q "^siaddr" \$UDHCPD_CONF || echo "siaddr \$(ifconfig \$INTERFACE | grep inet.ad | cut -d: -f2 | cut -d\  -f1)" >> \$UDHCPD_CONF</action>
   8.309 +	  <action>[ -f \$PXE_CONF ] || echo -e "label linux\n\tkernel bzImage\n\tappend initrd=rootfs.gz rw root=/dev/null vga=normal" > \$PXE_CONF</action>
   8.310 +          <action type="lauch">leafpad \$PXE_CONF</action>
   8.311 +        </button>
   8.312 +      </hbox>
   8.313 +      <hbox>
   8.314 +$(wikibutton http://doc.slitaz.org/en:guides:pxe)
   8.315 +        <button>
   8.316 +          <input file icon="system-file-manager"></input>
   8.317 +	  <label>Network boot files</label>
   8.318 +	  <action>$xterm -geometry 100x25 -title "Network boot files (q to quit)" -e "find \$(dirname \$(dirname \$PXE_CONF)) -exec ls -ld {} \; | less"</action>
   8.319 +        </button>
   8.320 +      </hbox>
   8.321 +     </frame>
   8.322 +EOT
   8.323 +}
   8.324 +
   8.325 +data_pxe()
   8.326 +{
   8.327 +[ -f /usr/share/boot/pxelinux.0.lzma ] && cat <<EOT
   8.328 +true        PXElinux          tab_pxelinux
   8.329 +EOT
   8.330 +[ -f /usr/share/boot/gpxe.pxe ] && cat <<EOT
   8.331 +true        PXE\ forwarder    tab_gpxe
   8.332 +EOT
   8.333 +}
   8.334 +
   8.335 +#
   8.336 +# PXE
   8.337 +#
   8.338 +tab_pxe()
   8.339 +{
   8.340 +use_tab data_pxe
   8.341 +}
   8.342 +
   8.343 +#
   8.344 +# Busybox dnsd
   8.345 +#
   8.346 +tab_dnsd()
   8.347 +{
   8.348 +cat <<EOT
   8.349 +    <frame Dnsd (busybox master dns)>
   8.350 +$(helpdaemon dnsd 80x24 DNSD_OPTIONS DNSD_OPTS)
   8.351 +$(configfile /etc/dnsd.conf DNSD_CONF)
   8.352 +      <hbox>
   8.353 +	$(startstopdaemon dnsd busybox)
   8.354 +      </hbox>
   8.355 +     </frame>
   8.356 +EOT
   8.357 +}
   8.358 +
   8.359 +#
   8.360 +# ISC Bind
   8.361 +#
   8.362 +tab_named()
   8.363 +{
   8.364 +cat <<EOT
   8.365 +    <frame Named (ISC bind)>
   8.366 +$(helpdaemon named 80x10 NAMED_OPTIONS NAMED_OPTS)
   8.367 +$(configfile /etc/bind/named.conf.local NAMED_CONF)
   8.368 +      <hbox>
   8.369 +	$(startstopdaemon named bind)
   8.370 +      </hbox>
   8.371 +     </frame>
   8.372 +EOT
   8.373 +}
   8.374 +
   8.375 +#
   8.376 +# DNSmasq 
   8.377 +#
   8.378 +tab_dnsmasq()
   8.379 +{
   8.380 +cat <<EOT
   8.381 +    <frame DNSmasq (DNS/DHCP/TFTP)>
   8.382 +$(helpdaemon dnsmasq 100x34 DNSMASQ_OPTIONS DNSMASQ_OPTS)
   8.383 +$(configfile /etc/dnsmasq.conf DNSMASQ_CONF)
   8.384 +      <hbox>
   8.385 +	$(startstopdaemon dnsmasq)
   8.386 +      </hbox>
   8.387 +     </frame>
   8.388 +EOT
   8.389 +}
   8.390 +
   8.391 +data_dns()
   8.392 +{
   8.393 +cat <<EOT
   8.394 +dnsd        Dnsd          tab_dnsd
   8.395 +named       Named         tab_named
   8.396 +dnsmasq     DNSmasq       tab_dnsmasq
   8.397 +#TODO sheerdns    Sheerdns      tab_sheerdns
   8.398 +EOT
   8.399 +}
   8.400 +
   8.401 +#
   8.402 +# dns tab
   8.403 +#
   8.404 +tab_dns()
   8.405 +{
   8.406 +use_tab data_dns
   8.407 +}
   8.408 +
   8.409 +#
   8.410 +# Postfix 
   8.411 +#
   8.412 +tab_postfix()
   8.413 +{
   8.414 +cat <<EOT
   8.415 +    <frame Postfix>
   8.416 +$(configfile /etc/postfix/main.cf POSTFIX_CONF)
   8.417 +      <hbox>
   8.418 +	$(startstopdaemon postfix)
   8.419 +      </hbox>
   8.420 +     </frame>
   8.421 +EOT
   8.422 +}
   8.423 +
   8.424 +#
   8.425 +# Fetchmail 
   8.426 +#
   8.427 +tab_fetchmail()
   8.428 +{
   8.429 +cat <<EOT
   8.430 +    <frame Fetchmail>
   8.431 +$(helpdaemon fetchmail 100x34 FETCHMAIL_OPTIONS FETCHMAIL_OPTS)
   8.432 +$(configfile /etc/fetchmail.conf FETCHMAIL_CONF)
   8.433 +      <hbox>
   8.434 +	$(startstopdaemon fetchmail)
   8.435 +      </hbox>
   8.436 +     </frame>
   8.437 +EOT
   8.438 +}
   8.439 +
   8.440 +#
   8.441 +# Postgrey 
   8.442 +#
   8.443 +tab_postgrey()
   8.444 +{
   8.445 +cat <<EOT
   8.446 +    <frame Postgrey (SMTP grey list)>
   8.447 +$(helpdaemon postgrey 100x34 POSTGREY_OPTIONS POSTGREY_OPTS)
   8.448 +      <hbox>
   8.449 +	$(startstopdaemon postgrey)
   8.450 +      </hbox>
   8.451 +     </frame>
   8.452 +EOT
   8.453 +}
   8.454 +
   8.455 +data_smtp()
   8.456 +{
   8.457 +cat <<EOT
   8.458 +postfix     Postfix       tab_postfix
   8.459 +fetchmail   Fetchmail     tab_fetchmail
   8.460 +postgrey    Grey\ list    tab_postgrey
   8.461 +EOT
   8.462 +}
   8.463 +
   8.464 +#
   8.465 +# smtp tab
   8.466 +#
   8.467 +tab_smtp()
   8.468 +{
   8.469 +use_tab data_smtp
   8.470 +}
   8.471 +
   8.472 +#
   8.473 +# Cyrus IMAP 
   8.474 +#
   8.475 +tab_cyrus()
   8.476 +{
   8.477 +cat <<EOT
   8.478 +    <frame Cyrus IMAP/POP3>
   8.479 +$(configfile /etc/imapd.conf IMAPD_CONF)
   8.480 +$(configfile /etc/cyrus.conf CYRUS_CONF)
   8.481 +      <hbox>
   8.482 +	$(startstopdaemon cyrus-imapd)
   8.483 +      </hbox>
   8.484 +     </frame>
   8.485 +EOT
   8.486 +}
   8.487 +
   8.488 +#
   8.489 +# Perdition IMAP/POP3 proxy
   8.490 +#
   8.491 +tab_perdition()
   8.492 +{
   8.493 +cat <<EOT
   8.494 +    <frame Perdition IMAP/POP3 proxy>
   8.495 +$(helpdaemon perdition 100x34 PERDITION_OPTIONS PERDITION_OPTS)
   8.496 +$(configfile /etc/perdition/perdition.imap4.conf PROXY_IMAP_CONF)
   8.497 +$(configfile /etc/perdition/perdition.pop3.conf PROXY_POP3_CONF)
   8.498 +      <hbox>
   8.499 +	$(startstopdaemon perdition)
   8.500 +      </hbox>
   8.501 +     </frame>
   8.502 +EOT
   8.503 +}
   8.504 +
   8.505 +data_imap()
   8.506 +{
   8.507 +cat <<EOT
   8.508 +cyradm      Cyrus         tab_cyrus
   8.509 +perdition   Proxy         tab_perdition
   8.510 +EOT
   8.511 +}
   8.512 +
   8.513 +#
   8.514 +# imap tab
   8.515 +#
   8.516 +tab_imap()
   8.517 +{
   8.518 +use_tab data_imap
   8.519 +}
   8.520 +
   8.521 +#
   8.522 +# Squid 
   8.523 +#
   8.524 +tab_squid()
   8.525 +{
   8.526 +cat <<EOT
   8.527 +    <frame Squid>
   8.528 +$(helpdaemon squid 100x26 SQUID_OPTIONS SQUID_OPTS)
   8.529 +$(configfile /etc/squid.conf SQUID_CONF)
   8.530 +$([ -s /etc/squidGuard/squidGuard.conf ] && configfile /etc/squidGuard/squidGuard.conf SQUIDGUARD_CONF)
   8.531 +      <hbox>
   8.532 +	$(startstopdaemon squid)
   8.533 +      </hbox>
   8.534 +     </frame>
   8.535 +EOT
   8.536 +}
   8.537 +
   8.538 +#
   8.539 +# Asterisk 
   8.540 +#
   8.541 +tab_asterisk()
   8.542 +{
   8.543 +cat <<EOT
   8.544 +    <frame Asterisk telephony>
   8.545 +$(configfile /etc/asterisk/extensions.conf ASTERISK_CONF)
   8.546 +      <hbox>
   8.547 +	$(startstopdaemon asterisk)
   8.548 +      </hbox>
   8.549 +     </frame>
   8.550 +EOT
   8.551 +}
   8.552 +
   8.553 +#
   8.554 +# OpenLDAP 
   8.555 +#
   8.556 +tab_openldap()
   8.557 +{
   8.558 +cat <<EOT
   8.559 +    <frame OpenLDAP>
   8.560 +$(configfile /etc/openldap/slapd.conf LDAP_CONF)
   8.561 +      <hbox>
   8.562 +	$(startstopdaemon openldap)
   8.563 +      </hbox>
   8.564 +     </frame>
   8.565 +EOT
   8.566 +}
   8.567 +
   8.568 +#
   8.569 +# MySQL 
   8.570 +#
   8.571 +tab_mysql()
   8.572 +{
   8.573 +cat <<EOT
   8.574 +    <frame MySQL>
   8.575 +$(helpdaemon mysqld_safe 100x24 MYSQL_OPTIONS MYSQL_OPTS)
   8.576 +$(configfile /etc/my.conf MYSQL_CONF)
   8.577 +      <hbox>
   8.578 +	$(startstopdaemon mysql)
   8.579 +      </hbox>
   8.580 +     </frame>
   8.581 +EOT
   8.582 +}
   8.583 +
   8.584 +#
   8.585 +# PostgreSQL 
   8.586 +#
   8.587 +tab_postgresql()
   8.588 +{
   8.589 +cat <<EOT
   8.590 +    <frame PostgreSQL>
   8.591 +$(helpdaemon postgres 100x34 PGSQL_OPTIONS PGSQL_OPTS)
   8.592 +$(configfile /etc/postgresql.conf POSTGRESQL_CONF)
   8.593 +      <hbox>
   8.594 +	$(startstopdaemon postgresql)
   8.595 +      </hbox>
   8.596 +     </frame>
   8.597 +EOT
   8.598 +}
   8.599 +
   8.600 +data_sql()
   8.601 +{
   8.602 +cat <<EOT
   8.603 +mysqld_safe MySQL         tab_mysql
   8.604 +postgres    PostgreSQL    tab_postgresql
   8.605 +EOT
   8.606 +}
   8.607 +
   8.608 +#
   8.609 +# sql tab
   8.610 +#
   8.611 +tab_sql()
   8.612 +{
   8.613 +use_tab data_sql
   8.614 +}
   8.615 +
   8.616 +#
   8.617 +# Slim display manager 
   8.618 +#
   8.619 +tab_slim()
   8.620 +{
   8.621 +cat <<EOT
   8.622 +    <frame Slim display manager>
   8.623 +$(helpdaemon slim 80x10 SLIM_OPTIONS SLIM_OPTS)
   8.624 +$(configfile /etc/slim.conf SLIM_CONF)
   8.625 +      <hbox>
   8.626 +	$(startstopdaemon slim)
   8.627 +      </hbox>
   8.628 +     </frame>
   8.629 +EOT
   8.630 +}
   8.631 +
   8.632 +#
   8.633 +# Cron 
   8.634 +#
   8.635 +tab_cron()
   8.636 +{
   8.637 +cat <<EOT
   8.638 +    <frame Crond (busybox)>
   8.639 +$(helpdaemon crond 80x15 CROND_OPTIONS CROND_OPTS)
   8.640 +      <hbox>
   8.641 +	$(startstopdaemon crond)
   8.642 +      </hbox>
   8.643 +     </frame>
   8.644 +EOT
   8.645 +}
   8.646 +
   8.647 +#
   8.648 +# NTP
   8.649 +#
   8.650 +tab_ntp()
   8.651 +{
   8.652 +cat <<EOT
   8.653 +    <frame Ntpd>
   8.654 +$(helpdaemon ntpd 100x34 NTP_OPTIONS NTP_OPTS)
   8.655 +$(configfile /etc/ntp.conf NTP_CONF)
   8.656 +      <hbox>
   8.657 +	$(startstopdaemon ntp)
   8.658 +      </hbox>
   8.659 +     </frame>
   8.660 +EOT
   8.661 +}
   8.662 +
   8.663 +#
   8.664 +# nfsd
   8.665 +#
   8.666 +tab_nfsd()
   8.667 +{
   8.668 +cat <<EOT
   8.669 +    <frame Nfsd>
   8.670 +$(configfile /etc/exports EXPORTS)
   8.671 +      <hbox>
   8.672 +	$(startstopdaemon nfsd nfs-utils)
   8.673 +      </hbox>
   8.674 +     </frame>
   8.675 +EOT
   8.676 +}
   8.677 +
   8.678 +#
   8.679 +# unfsd
   8.680 +#
   8.681 +tab_unfsd()
   8.682 +{
   8.683 +cat <<EOT
   8.684 +    <frame Unfsd>
   8.685 +$(helpdaemon ntpd 80x20 UNFSD_OPTIONS UNFSD_OPTS)
   8.686 +$(configfile /etc/exports EXPORTS)
   8.687 +      <hbox>
   8.688 +	$(startstopdaemon unfsd unfs3)
   8.689 +      </hbox>
   8.690 +     </frame>
   8.691 +EOT
   8.692 +}
   8.693 +
   8.694 +data_nfs()
   8.695 +{
   8.696 +cat <<EOT
   8.697 +rpc.nfsd    Nfsd          tab_nfsd
   8.698 +unfsd       Unfsd         tab_unfsd 
   8.699 +EOT
   8.700 +}
   8.701 +
   8.702 +#
   8.703 +# nfs tab
   8.704 +#
   8.705 +tab_nfs()
   8.706 +{
   8.707 +use_tab data_nfs
   8.708 +}
   8.709 +
   8.710 +#
   8.711 +# ftpd
   8.712 +#
   8.713 +tab_ftpd()
   8.714 +{
   8.715 +cat <<EOT
   8.716 +    <frame ftpd>
   8.717 +$(helpdaemon ftpd 100x34 FTPD_OPTIONS FTPD_OPTS)
   8.718 +      <hbox>
   8.719 +	$(startstopdaemon ftpd)
   8.720 +      </hbox>
   8.721 +     </frame>
   8.722 +EOT
   8.723 +}
   8.724 +
   8.725 +#
   8.726 +# pure-ftpd
   8.727 +#
   8.728 +tab_pureftpd()
   8.729 +{
   8.730 +cat <<EOT
   8.731 +    <frame pure-ftpd>
   8.732 +$(helpdaemon pure-ftpd 80x34 PUREFTPD_OPTIONS PUREFTPD_OPTS)
   8.733 +      <hbox>
   8.734 +	$(startstopdaemon pure-ftpd)
   8.735 +      </hbox>
   8.736 +     </frame>
   8.737 +EOT
   8.738 +}
   8.739 +
   8.740 +data_ftp()
   8.741 +{
   8.742 +cat <<EOT
   8.743 +$(readlink /usr/bin/ftpd | grep -q busybox && echo "true" ||
   8.744 +echo "#")   Busybox\ ftpd tab_ftpd
   8.745 +pure-ftpd   pure-ftpd     tab_pureftpd
   8.746 +EOT
   8.747 +}
   8.748 +
   8.749 +#
   8.750 +# ftp tab
   8.751 +#
   8.752 +tab_ftp()
   8.753 +{
   8.754 +use_tab data_ftp
   8.755 +}
   8.756 +
   8.757 +#
   8.758 +# NTP
   8.759 +#
   8.760 +tab_ntp()
   8.761 +{
   8.762 +cat <<EOT
   8.763 +    <frame Ntpd>
   8.764 +$(helpdaemon ntpd 80x20 NTP_OPTIONS NTP_OPTS)
   8.765 +$(configfile /etc/ntp.conf NTP_CONF)
   8.766 +      <hbox>
   8.767 +	$(startstopdaemon ntp)
   8.768 +      </hbox>
   8.769 +     </frame>
   8.770 +EOT
   8.771 +}
   8.772 +
   8.773 +#
   8.774 +# cups
   8.775 +#
   8.776 +tab_cups()
   8.777 +{
   8.778 +cat <<EOT
   8.779 +    <frame Cupsd>
   8.780 +$(helpdaemon cupsd 80x12 CUPSD_OPTIONS CUPSD_OPTS)
   8.781 +$(configfile /etc/cups/cupsd.conf CUPSD_CONF)
   8.782 +      <hbox>
   8.783 +	$(startstopdaemon cupsd)
   8.784 +      </hbox>
   8.785 +     </frame>
   8.786 +EOT
   8.787 +}
   8.788 +
   8.789 +#
   8.790 +# rsync server
   8.791 +#
   8.792 +tab_rsync()
   8.793 +{
   8.794 +cat <<EOT
   8.795 +     <frame Rsync>
   8.796 +$(helpdaemon rsync 80x30 RSYNCD_OPTIONS RSYNCD_OPTS 1)
   8.797 +$(configfile /etc/rsyncd.conf RSYNCD_CONF)
   8.798 +$(datafile /etc/rsyncd.secrets RSYNCD_SECRETS 'Secrets file     :')
   8.799 +      <hbox>
   8.800 +	$(startstopdaemon rsyncd rsync)
   8.801 +      </hbox>
   8.802 +     </frame>
   8.803 +EOT
   8.804 +}
   8.805 +
   8.806 +php_ini()
   8.807 +{
   8.808 +[ -f /etc/php.ini ] && cat <<EOT
   8.809 +      <frame PHP>
   8.810 +$(configfile /etc/php.ini PHP_CONF)
   8.811 +      </frame>
   8.812 +EOT
   8.813 +}
   8.814 +
   8.815 +#
   8.816 +# Apache server
   8.817 +#
   8.818 +tab_apache()
   8.819 +{
   8.820 +cat <<EOT
   8.821 +     <frame Apache>
   8.822 +$(configfile /etc/apache/httpd.conf HTTPD_CONF)
   8.823 +$(php_ini)
   8.824 +      <hbox>
   8.825 +	$(startstopdaemon apache)
   8.826 +      </hbox>
   8.827 +     </frame>
   8.828 +EOT
   8.829 +}
   8.830 +
   8.831 +#
   8.832 +# Lighttpd server
   8.833 +#
   8.834 +tab_lighttpd()
   8.835 +{
   8.836 +cat <<EOT
   8.837 +     <frame Lighttpd>
   8.838 +$(helpdaemon lighttpd 80x15 LIGHTTPD_OPTIONS LIGHTTPD_OPTS)
   8.839 +$(configfile /etc/lighttpd/lighttpd.conf LIGHTTPD_CONF)
   8.840 +$(php_ini)
   8.841 +      <hbox>
   8.842 +	$(startstopdaemon lighttpd)
   8.843 +      </hbox>
   8.844 +     </frame>
   8.845 +EOT
   8.846 +}
   8.847 +
   8.848 +#
   8.849 +# Busybox httpd server
   8.850 +#
   8.851 +tab_httpd()
   8.852 +{
   8.853 +cat <<EOT
   8.854 +     <frame httpd (busybox)>
   8.855 +$(helpdaemon httpd 80x30 HTTPD_OPTIONS HTTPD_OPTS)
   8.856 +$(configfile /etc/httpd.conf HTTPD_CONF)
   8.857 +$(php_ini)
   8.858 +      <hbox>
   8.859 +	$(startstopdaemon httpd busybox)
   8.860 +      </hbox>
   8.861 +     </frame>
   8.862 +EOT
   8.863 +}
   8.864 +
   8.865 +data_http()
   8.866 +{
   8.867 +cat <<EOT
   8.868 +/etc/apache/httpd.conf  Apache          tab_apache
   8.869 +lighttpd                Lighttpd        tab_lighttpd
   8.870 +/etc/httpd.conf         Busybox\ httpd  tab_httpd
   8.871 +squid                   Web\ cache      tab_squid
   8.872 +EOT
   8.873 +}
   8.874 +
   8.875 +#
   8.876 +# http tab
   8.877 +#
   8.878 +tab_http()
   8.879 +{
   8.880 +use_tab data_http
   8.881 +}
   8.882 +
   8.883 +#
   8.884 +# Samba servers
   8.885 +#
   8.886 +tab_wins()
   8.887 +{
   8.888 +cat <<EOT
   8.889 +     <frame Samba: smbd & nmbd>
   8.890 +$(configfile /etc/samba/smb.conf SMBD_CONF)
   8.891 +      <hbox>
   8.892 +        <button>
   8.893 +          <label>Reload</label>
   8.894 +          <input file icon="reload"></input>
   8.895 +          <action>/etc/init.d/samba reload</action>
   8.896 +        </button>
   8.897 +	$(startstopdaemon samba)
   8.898 +      </hbox>
   8.899 +     </frame>
   8.900 +EOT
   8.901 +}
   8.902 +
   8.903 +#
   8.904 +# x11vnc
   8.905 +#
   8.906 +tab_vnc()
   8.907 +{
   8.908 +cat <<EOT
   8.909 +     <frame x11vnc>
   8.910 +$(helpdaemon x11vnc 80x30 X11VNC_OPTIONS X11VNC_OPTS)
   8.911 +      <hbox>
   8.912 +        <text use-markup="true">
   8.913 +          <label>"<b>New password</b>"</label>
   8.914 +        </text>
   8.915 +        <entry>
   8.916 +          <variable>X11VNC_PASSWD</variable>
   8.917 +        </entry>
   8.918 +        <button>
   8.919 +          <input file icon="reload"></input>
   8.920 +          <label>Update</label>
   8.921 +          <action>x11vnc -storepasswd \$X11VNC_PASSWD /etc/vnc.secret</action>
   8.922 +        </button>
   8.923 +      </hbox>
   8.924 +      <hbox>
   8.925 +	$(startstopdaemon x11vnc)
   8.926 +      </hbox>
   8.927 +     </frame>
   8.928 +EOT
   8.929 +}
   8.930 +
   8.931 +#
   8.932 +# knock server
   8.933 +#
   8.934 +tab_knockd()
   8.935 +{
   8.936 +cat <<EOT
   8.937 +    <frame Knockd: trigger backdoors>
   8.938 +$(helpdaemon knockd 80x15 KNOCK_OPTIONS KNOCK_OPTS)
   8.939 +$(configfile /etc/knockd.conf KNOCKD_CONF)
   8.940 +      <hbox>
   8.941 +	$(startstopdaemon knockd knock)
   8.942 +      </hbox>
   8.943 +     </frame>
   8.944 +EOT
   8.945 +}
   8.946 +
   8.947 +data_servers()
   8.948 +{
   8.949 +local $pxe
   8.950 +pxe="#"
   8.951 +[ -x /usr/bin/tftpd -a -x /usr/sbin/udhcpd ] && pxe="inetd"
   8.952 +[ -x /usr/sbin/dnsmasq ] && pxe="true"
   8.953 +[ -f /usr/share/boot/pxelinux.0.lzma -o /usr/share/boot/gpxe.pxe ] || pxe="#"
   8.954 +cat <<EOT
   8.955 +slim        Slim          tab_slim
   8.956 +crond       Crond         tab_cron
   8.957 +inetd       Inetd         tab_inetd
   8.958 +zcip        ZeroConf      tab_zcip
   8.959 +$([ -x /usr/sbin/udhcpd -o -x /usr/sbin/dhcpd -o -x /usr/sbin/dnsmasq ] && 
   8.960 +echo "true" ||
   8.961 +echo "#")   DHCP          tab_dhcpd
   8.962 +$pxe        PXE           tab_pxe
   8.963 +$([ -x /usr/sbin/dnsd -o -x /usr/sbin/named -o -x /usr/sbin/dnsmasq ] && 
   8.964 +echo "true" ||
   8.965 +echo "#")   DNS           tab_dns
   8.966 +ntpd        NTP           tab_ntp
   8.967 +cupsd       CUPS          tab_cups
   8.968 +$([ -x /usr/bin/mysqld_safe -o -x /usr/bin/postgres ] && echo "true" ||
   8.969 +echo "#")   SQL           tab_sql
   8.970 +knockd      Knock         tab_knockd
   8.971 +$([ -x /usr/sbin/dropbear -o -x /usr/sbin/sshd ] && echo "true" ||
   8.972 +echo "#")   SSH           tab_sshd
   8.973 +x11vnc      VNC           tab_vnc 
   8.974 +dnsmasq     TFTP          tab_dnsmasq
   8.975 +$([ -x /usr/bin/ftpd -o -x /usr/sbin/pure-ftpd ] && echo "true" ||
   8.976 +echo "#")   FTP           tab_ftp
   8.977 +$([ -x /usr/sbin/lighttpd -o -x /usr/bin/httpd -o -x /usr/sbin/squid ] && echo "true" || 
   8.978 +echo "#")   HTTP          tab_http
   8.979 +rsync       Rsync         tab_rsync
   8.980 +$([ -x /usr/sbin/rpc.nfsd -o -x /usr/bin/unfsd ] && echo "true" ||
   8.981 +echo "#")   NFS           tab_nfs
   8.982 +smbd        SAMBA         tab_wins
   8.983 +slapcat     LDAP          tab_openldap
   8.984 +postfix     SMTP          tab_smtp
   8.985 +cyradm      IMAP          tab_imap
   8.986 +asterisk    Telephony     tab_asterisk
   8.987 +#TODO+callback pppd        Pppd          tab_pppd
   8.988 +#TODO pptpd       PoPToP        tab_poptop
   8.989 +EOT
   8.990 +}
   8.991 +
   8.992 +#
   8.993 +# Servers tab
   8.994 +#
   8.995 +tab_servers()
   8.996 +{
   8.997 +use_tab data_servers
   8.998 +}
   8.999 +
  8.1000 +#
  8.1001 +# Firewall tab
  8.1002 +#
  8.1003 +tab_firewall()
  8.1004 +{
  8.1005 +cat <<EOT
  8.1006 +    <frame Iptables>
  8.1007 +$(configfile /etc/firewall.conf IPTABLES_CONF)
  8.1008 +      <hbox>
  8.1009 +$(helpbutton iptables 80x30)
  8.1010 +$(manbutton 8 iptables)
  8.1011 +$(webbutton iptables)
  8.1012 +        <button>
  8.1013 +          <label>Load</label>
  8.1014 +          <input file icon="reload"></input>
  8.1015 +          <action>cat \$IPTABLES_CONF | /sbin/iptables-restore</action>
  8.1016 +        </button>
  8.1017 +        <button>
  8.1018 +          <label>Save</label>
  8.1019 +          <input file icon="go-jump"></input>
  8.1020 +          <action>/sbin/iptables-save > \$IPTABLES_CONF</action>
  8.1021 +        </button>
  8.1022 +      </hbox>
  8.1023 +     </frame>
  8.1024 +EOT
  8.1025 +}
  8.1026 +
  8.1027 +#
  8.1028 +# knock client
  8.1029 +#
  8.1030 +tab_knock()
  8.1031 +{
  8.1032 +cat <<EOT
  8.1033 +    <frame Knock>
  8.1034 +    <hbox>
  8.1035 +      <text use-markup="true">
  8.1036 +        <label>"<b>Options : </b>"</label>
  8.1037 +      </text>
  8.1038 +      <entry editable="true">
  8.1039 +        <variable>KNOCK_OPTS</variable>
  8.1040 +	<default>myserver.example.com 123:tcp 456:udp 789:tcp</default>
  8.1041 +      </entry>
  8.1042 +    </hbox>
  8.1043 +    <hbox>
  8.1044 +$(helpbutton knock 80x12)
  8.1045 +      <button>
  8.1046 +        <label>Start</label>
  8.1047 +        <input file icon="forward"></input>
  8.1048 +        <action>knock \$KNOCK_OPTS</action>
  8.1049 +      </button>
  8.1050 +    </hbox>
  8.1051 +    </frame>
  8.1052 +EOT
  8.1053 +}
  8.1054 +
  8.1055 +data_main()
  8.1056 +{
  8.1057 +cat <<EOT
  8.1058 +#program    tab name      function
  8.1059 +true        Servers       tab_servers
  8.1060 +iptables    Firewall      tab_firewall
  8.1061 +knock       Knock         tab_knock
  8.1062 +true        Status        tab_status
  8.1063 +EOT
  8.1064 +}
  8.1065 +
  8.1066 +tab_main()
  8.1067 +{
  8.1068 +use_tab data_main
  8.1069 +}
  8.1070 +
  8.1071 +######################################################
  8.1072 +#
  8.1073 +# Serverbox GUI
  8.1074 +#
  8.1075 +######################################################
  8.1076 +
  8.1077 +# Only root can configure server.
  8.1078 +check_root
  8.1079 +
  8.1080 +# English/French help dialog.
  8.1081 +export HELP='
  8.1082 +<window title="Network status" icon-name="network-wire">
  8.1083 +<vbox>
  8.1084 +	<text use-markup="true">
  8.1085 +		<label>
  8.1086 +"
  8.1087 +<b>SliTaz - Serverbox</b>"
  8.1088 +		</label>
  8.1089 +	</text>
  8.1090 +	<frame English>
  8.1091 +		<text wrap="true" width-chars="58">
  8.1092 +			<label>
  8.1093 +"Serverbox lets you manage and setup servers. First, install and 
  8.1094 +edit any configuration files. Then, start or stop the servers."
  8.1095 +			</label>
  8.1096 +		</text>
  8.1097 +	</frame>
  8.1098 +	<frame Francais>
  8.1099 +		<text wrap="true" width-chars="58">
  8.1100 +			<label>
  8.1101 +"Serverbox peut demarrer ou arreter le reseau, configurer
  8.1102 +les interfaces reseau ou editer directement les fichiers."
  8.1103 +			</label>
  8.1104 +		</text>
  8.1105 +	</frame>
  8.1106 +</vbox>
  8.1107 +</window>
  8.1108 +'
  8.1109 +
  8.1110 +# The main dialog with notebook, start/stop buttons and all options.
  8.1111 +# Note that /etc/network.conf is seded when an interface is activated.
  8.1112 +#
  8.1113 +head='
  8.1114 +<window title="SliTaz Server Manager" icon-name="network-wired">
  8.1115 +	<vbox>
  8.1116 +
  8.1117 +		<hbox>
  8.1118 +			<text use-markup="true">
  8.1119 +				<label>"<b>Server Manager</b>"</label>
  8.1120 +			</text>
  8.1121 +			<pixmap>
  8.1122 +				<input file>/usr/share/pixmaps/netbox.png</input>
  8.1123 +			</pixmap>
  8.1124 +		</hbox>
  8.1125 +'
  8.1126 +bottom='
  8.1127 +		<hbox>
  8.1128 +			<button help>
  8.1129 +				<label>Help</label>
  8.1130 +				<action type="launch">HELP</action>
  8.1131 +			</button>
  8.1132 +			<button>
  8.1133 +				<label>Quit</label>
  8.1134 +				<input file icon="exit"></input>
  8.1135 +				<action type="exit">Exit</action>
  8.1136 +			</button>
  8.1137 +		</hbox>
  8.1138 +
  8.1139 +	</vbox>
  8.1140 +</window>
  8.1141 +'
  8.1142 +
  8.1143 +SERVER_BOX="${head}$(tab_main)${bottom}"
  8.1144 +
  8.1145 +export SERVER_BOX
  8.1146 +
  8.1147 +gtkdialog --center --program=SERVER_BOX >/dev/null
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/oldstuff/gtkdialog/serverbox.desktop	Sat Apr 28 20:21:10 2012 +0200
     9.3 @@ -0,0 +1,10 @@
     9.4 +[Desktop Entry]
     9.5 +Encoding=UTF-8
     9.6 +Name=Manage servers
     9.7 +Name[fr]=Gérer les serveurs
     9.8 +Name[pt]=Gerenciar servidores
     9.9 +Name[pt_BR]=Gerenciar servidores
    9.10 +Exec=subox serverbox
    9.11 +Icon=utilities-system-monitor
    9.12 +Type=Application
    9.13 +Categories=System;Application;
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/oldstuff/gtkdialog/sshbox	Sat Apr 28 20:21:10 2012 +0200
    10.3 @@ -0,0 +1,498 @@
    10.4 +#! /bin/sh
    10.5 +# 
    10.6 +# Gtkdialog box interface for SSH connections.
    10.7 +#
    10.8 +# Manage profile in .prf files store in $HOME/.sshbox 
    10.9 +# (c) 2009 SliTaz GNU/Linux - GNU gpl v3
   10.10 +#
   10.11 +
   10.12 +
   10.13 +# Create config directory and init default var
   10.14 +export VERSION=0.2
   10.15 +export PROGNAME="SSHBox"
   10.16 +export PROG="$0"
   10.17 +export CONFIG_DIR=$HOME/.config/sshbox
   10.18 +export TEMP=/tmp/$(basename $PROG).out
   10.19 +
   10.20 +# Create $CONFIG_DIR if it doesn't exist.
   10.21 +[ -d $HOME/$CONFIG_DIR/session ] || mkdir -p $CONFIG_DIR/session
   10.22 +
   10.23 +# Set locale message if message file exists and $LANG is set.
   10.24 +# Default: English 
   10.25 +if [ -f /usr/share/locale/${LANG%%_*}/LC_MESSAGES/sshbox.msg ]; then
   10.26 +	. /usr/share/locale/${LANG%%_*}/LC_MESSAGES/sshbox.msg 
   10.27 +fi
   10.28 +
   10.29 +##
   10.30 +# Function
   10.31 +##
   10.32 +add_session(){
   10.33 +	export GTK_ADD_PROFILE="
   10.34 +		<window title=\"${TITLE_ADD_PROFILE:-Add new session}\" icon-name=\"sunny\">
   10.35 +			<vbox>
   10.36 +			<hbox>
   10.37 +				<text>
   10.38 +					<label>\"${LBL_SESSION:-Session}:\"</label>
   10.39 +				</text>
   10.40 +				<entry>
   10.41 +					<variable>SESSION</variable>
   10.42 +				</entry>
   10.43 +				</hbox>
   10.44 +				<hbox>
   10.45 +				<text>
   10.46 +					<label>\"${LBL_HOSTNAME:-Hostname}:\"</label>
   10.47 +				</text>
   10.48 +				<entry>
   10.49 +					<variable>SSH_HOST</variable>
   10.50 +				</entry>
   10.51 +
   10.52 +				</hbox>
   10.53 +				<hbox>
   10.54 +				<text>
   10.55 +					<default>22</default>
   10.56 +					<label>\"${LBL_PORT-Port}:\"</label>
   10.57 +				</text>
   10.58 +				<entry width_chars=\"5\" max-length=\"5\">
   10.59 +				<default>22</default>
   10.60 +					<variable>SSH_PORT</variable>
   10.61 +				</entry>
   10.62 +				</hbox>
   10.63 +				<hbox>
   10.64 +				<text>
   10.65 +					<label>\"${LBL_USERNAME-Username}:\"</label>
   10.66 +				</text>
   10.67 +				<entry>
   10.68 +					<variable>SSH_USER</variable>
   10.69 +				</entry>
   10.70 +				</hbox>
   10.71 +			<hbox>
   10.72 +			<button>
   10.73 +				<label>${BTN_SAVE:-Save}</label>
   10.74 +				<input file icon=\"gtk-floppy\"></input>
   10.75 +				<action>$PROG save_session $SESSION</action>
   10.76 +				<action>refresh:USER_HOST</action>
   10.77 +				<action type=\"exit\">Exit</action>
   10.78 +			</button>
   10.79 +				<button cancel></button>
   10.80 +			</hbox>
   10.81 +				</vbox>
   10.82 +		</window>
   10.83 +	"
   10.84 +	gtkdialog  --center --program=GTK_ADD_PROFILE
   10.85 +}
   10.86 +
   10.87 +gtk_manage_session(){
   10.88 +	
   10.89 +	# Read the config file if it exists
   10.90 +	[ -f "$CONFIG_DIR/session/$SESSION.conf" ] && . "$CONFIG_DIR/session/$SESSION.conf"
   10.91 +	
   10.92 +	export GTK_MANAGE_SESSION="
   10.93 +		<window title=\"${TITLE_GTK_MANAGE:-Session} $SESSION\" icon-name=\"gnome-control-center\">
   10.94 +		<vbox>
   10.95 +					<hbox>
   10.96 +				<text>
   10.97 +					<label>\"${LBL_HOSTNAME:-Hostname}:\"</label>
   10.98 +				</text>
   10.99 +				<entry>
  10.100 +					<input>\"echo $HOSTNAME\"</input>
  10.101 +					<variable>SSH_HOST</variable>
  10.102 +				</entry>
  10.103 +			</hbox>
  10.104 +			<hbox>
  10.105 +				<text>
  10.106 +					<default>22</default>
  10.107 +					<label>\"${LBL_PORT-Port}:\"</label>
  10.108 +				</text>
  10.109 +				<entry width_chars=\"5\" max-length=\"5\">
  10.110 +					<input>\"echo $PORT\"</input>
  10.111 +					<variable>SSH_PORT</variable>
  10.112 +				</entry>
  10.113 +			</hbox>
  10.114 +			<hbox>
  10.115 +					<text>
  10.116 +						<label>\"${LBL_USERNAME-Username}:\"</label>
  10.117 +					</text>
  10.118 +					<entry>
  10.119 +						<input>\"echo $USER\"</input>
  10.120 +						<variable>SSH_USER</variable>
  10.121 +					</entry>
  10.122 +			</hbox>
  10.123 +			
  10.124 +		<hbox>
  10.125 +			<button>
  10.126 +				<label>${BTN_DELETE:-Delete}</label>
  10.127 +				<input file icon=\"gtk-delete\"></input>
  10.128 +				<action>$PROG delete_session $SESSION</action>
  10.129 +			</button>
  10.130 +			<button>
  10.131 +				<label>${BTN_SAVE:-Modify}</label>
  10.132 +				<input file icon=\"gtk-floppy\"></input>
  10.133 +				<action>$PROG save_session</action>
  10.134 +			</button>
  10.135 +			<button>
  10.136 +				<label>${BTN_CONNECT:-Connect}</label>
  10.137 +				<input file icon=\"gtk-connect\"></input>
  10.138 +				<action>$PROG ssh_connect</action>
  10.139 +			</button>
  10.140 +			<button cancel></button>
  10.141 +		</hbox>
  10.142 +		</vbox>
  10.143 +		</window>
  10.144 +	"
  10.145 +	gtkdialog --center --program=GTK_MANAGE_SESSION
  10.146 +}
  10.147 +
  10.148 +
  10.149 +# Display SettingsBox.
  10.150 +gtk_settings(){
  10.151 +	read_settings
  10.152 +	export GTK_SETTINGS="
  10.153 +		<window title=\"${TITLE_GTK_SETTINGS:-Properties}\" icon-name=\"gnome-control-center\">
  10.154 +			<vbox>
  10.155 +				<hbox>
  10.156 +					<text use-markup=\"true\">
  10.157 +						<label>\"${TXT_TERM:-Terminal}: \"</label>
  10.158 +					</text>
  10.159 +					<entry>
  10.160 +						<input>echo $XTERM</input>
  10.161 +						<variable>XTERM</variable>
  10.162 +					</entry>
  10.163 +					</hbox>
  10.164 +					<hbox>
  10.165 +						<text use-markup=\"true\">
  10.166 +							<label>\"${TXT_SSH_CLIENT:-SSH Client}: \"</label>
  10.167 +						</text>
  10.168 +						<entry>
  10.169 +							<input>echo $SSH_CLIENT</input>
  10.170 +							<variable>SSH_CLIENT</variable>
  10.171 +						</entry>
  10.172 +					</hbox>
  10.173 +					<hbox>
  10.174 +						<button ok></button>
  10.175 +						<button cancel></button>
  10.176 +					</hbox>
  10.177 +				</vbox>
  10.178 +				</window>
  10.179 +		"
  10.180 +		gtkdialog --center --program=GTK_SETTINGS > /tmp/_out_
  10.181 +		
  10.182 +		. /tmp/_out_
  10.183 +		
  10.184 +		if [ "$EXIT" == "OK" ]; then
  10.185 +			save_settings
  10.186 +		fi
  10.187 +}
  10.188 +
  10.189 +gtk_gen_key(){
  10.190 +		# Gen private key with dropbearkey
  10.191 +		#
  10.192 +		export GTK_GEN_KEY="
  10.193 +		<window title=\"${TITLE_GTK_MANAGE:-Session} $SESSION\" icon-name=\"gnome-control-center\">
  10.194 +		<vbox>
  10.195 +			<hbox>
  10.196 +				
  10.197 +			</hbox>
  10.198 +			<hbox>
  10.199 +			<button>
  10.200 +				<label>${BTN_CONNECT:-Connect}</label>
  10.201 +				<input file icon=\"gtk-connect\"></input>
  10.202 +				<action>$PROG ssh_connect</action>
  10.203 +			</button>
  10.204 +			<button cancel></button>
  10.205 +			</hbox>
  10.206 +		</vbox>
  10.207 +		"
  10.208 +}
  10.209 +
  10.210 +ssh_genkey(){
  10.211 +	echo "nop"
  10.212 +}
  10.213 +
  10.214 +list_ssh_key(){
  10.215 +	
  10.216 +	# dropbearkey -y -f foo_dss  | awk '/ssh-(dss|rsa)/ { print $3 "|" $1}'
  10.217 +
  10.218 +	for i in ${HOME}/.ssh/*.priv
  10.219 +	do
  10.220 +		[ -f $i ] && echo $(basename $i .priv)
  10.221 +	done
  10.222 +}
  10.223 +
  10.224 +list_host(){
  10.225 +	if [ -f $HOME/.ssh/known_hosts ]; then
  10.226 +		for i in "$(cat $HOME/.ssh/known_hosts)"; do echo "$i"| awk '{print $1}';done
  10.227 +	fi
  10.228 +}
  10.229 +
  10.230 +delete_host(){
  10.231 +	cp $HOME/.ssh/known_hosts /tmp/f.tmp && \
  10.232 +	awk -v host=$KNOWN_HOST 'match($0,host) == 0 {print $0}' /tmp/f.tmp > $HOME/.ssh/known_hosts
  10.233 +}
  10.234 +
  10.235 +quick_add_session(){
  10.236 +			export GTK_QUICK_ADD="
  10.237 +				<window title=\"${TITLE_QUICK_ADD:-Enter session name}\" icon-name=\"gtk-dialog-question\">
  10.238 +				<vbox>
  10.239 +					<hbox>
  10.240 +					<text>
  10.241 +						<label>\"${TXT_SESSION_NAME:-Session}:\"</label>
  10.242 +					</text>
  10.243 +					<entry>
  10.244 +						<variable>SESSION</variable>
  10.245 +					</entry>
  10.246 +					</hbox>
  10.247 +					<hbox>
  10.248 +					<button>
  10.249 +						<label>${BTN_SAVE:-Save}</label>
  10.250 +						<input file icon=\"gtk-apply\"></input>
  10.251 +						<action type=\"exit\">OK</action>
  10.252 +					</button>
  10.253 +					<button cancel></button>
  10.254 +					</hbox>
  10.255 +				</vbox>
  10.256 +				</window>
  10.257 +		"
  10.258 +		gtkdialog  --center --program=GTK_QUICK_ADD > ${TEMP} 
  10.259 +		
  10.260 +		if ( grep -q  'EXIT="OK"' $TEMP ); then
  10.261 +				. $TEMP
  10.262 +				echo "HOSTNAME=${SSH_HOST}" > ${CONFIG_DIR}/session/${SESSION}.conf
  10.263 +				echo "USER=${SSH_USER}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  10.264 +				echo "PORT=${SSH_PORT}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  10.265 +		fi
  10.266 +}
  10.267 +
  10.268 +edit_session(){
  10.269 +	echo "nop"
  10.270 +}
  10.271 +
  10.272 +save_session(){
  10.273 +	echo "HOSTNAME=${SSH_HOST}" > ${CONFIG_DIR}/session/${SESSION}.conf
  10.274 +	echo "USER=${SSH_USER}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  10.275 +	echo "PORT=${SSH_PORT}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  10.276 +}
  10.277 +
  10.278 +delete_session(){
  10.279 +	rm -f ${CONFIG_DIR}/session/${SESSION}.conf
  10.280 +}
  10.281 +
  10.282 +list_sessions(){
  10.283 +	
  10.284 +	for i in ${CONFIG_DIR}/session/*.conf
  10.285 +	do
  10.286 +		[ -f $i ] && echo "$(basename $i .conf)" | awk '{print"gtk-network|", $0}'
  10.287 +	done
  10.288 +}
  10.289 +
  10.290 +read_settings(){
  10.291 +	# Read user settings.
  10.292 +	# Init default settings if don't exist
  10.293 +	if [ -f ${CONFIG_DIR}/sshbox.conf ]; then
  10.294 +		. ${CONFIG_DIR}/sshbox.conf
  10.295 +	else
  10.296 +		echo "XTERM=xterm" > ${CONFIG_DIR}/sshbox.conf
  10.297 +		echo "SSH_CLIENT=ssh" >> ${CONFIG_DIR}/sshbox.conf
  10.298 +	fi
  10.299 +	export XTERM SSH_CLIENT 
  10.300 +}
  10.301 +
  10.302 +read_last_connection(){	
  10.303 +	# Read last connection
  10.304 +	[ -f $CONFIG_DIR/last ] &&  . $CONFIG_DIR/last
  10.305 +}	
  10.306 +
  10.307 +save_settings(){
  10.308 +	# Save user settings in user.pref.
  10.309 +	echo "XTERM=${XTERM:-xterm}" > $CONFIG_DIR/sshbox.conf
  10.310 +	echo "SSH_CLIENT=${SSH_CLIENT:-/usr/bin/ssh}" >> $CONFIG_DIR/sshbox.conf
  10.311 +}
  10.312 +
  10.313 +ssh_connect(){
  10.314 +	
  10.315 +	read_settings
  10.316 +	
  10.317 +	# TODO: Move this to another place
  10.318 +	# Save last used profile and start ssh connection
  10.319 +	echo "HOSTNAME=$SSH_HOST" > $CONFIG_DIR/last
  10.320 +	echo "USERNAME=$SSH_USER" >> $CONFIG_DIR/last
  10.321 +	echo "KEY=$SSH_KEY" >> $CONFIG_DIR/last
  10.322 +	
  10.323 +	$SSH_OPTIONS=""
  10.324 +	
  10.325 +	[ ! -z $SSH_PORT ] && SSH_OPTION="-p $SSH_PORT"
  10.326 +	
  10.327 +	# set terminal options
  10.328 +	if [ "$XTERM" ==  "sakura" ]; then
  10.329 +		OPTION="--title $SSH_USER@$SSH_HOST"
  10.330 +	else 
  10.331 +		OPTION="-T $SSH_USER@$SSH_HOST"
  10.332 +	fi
  10.333 +	
  10.334 +	exec $XTERM $OPTION -e "$SSH_CLIENT $SSH_OPTIONS $SSH_USER@$SSH_HOST" &
  10.335 +}
  10.336 +
  10.337 +gtk_about(){
  10.338 +		export GTK_ABOUT="
  10.339 +				<window title=\"${TITLE_ABOUT:-About} the $PROGNAMENAME\" icon-name=\"sunny\">
  10.340 +				<vbox>
  10.341 +					<pixmap>
  10.342 +						<input file stock=\"gtk-network\"></input>
  10.343 +					</pixmap>
  10.344 +					<text use-markup=\"true\">
  10.345 +					<label>\"<b>SSHBox v$VERSION</b>\"</label>
  10.346 +					</text>
  10.347 +					<text wrap=\"true\" width-chars=\"40\" use-markup=\"true\">
  10.348 +						<label>\"
  10.349 +Gtkdialog box interface for SSH connections.
  10.350 +
  10.351 +		SliTaz GNU/Linux - GPL v3
  10.352 +						\"
  10.353 +						</label>
  10.354 +					</text>
  10.355 +					<hbox><button ok></button></hbox>
  10.356 +				</vbox>
  10.357 +				</window>
  10.358 +		"
  10.359 +		gtkdialog  --center --program=GTK_ABOUT 
  10.360 +}
  10.361 +
  10.362 +main_dialog(){
  10.363 +	
  10.364 +	read_settings
  10.365 +	read_last_connection
  10.366 +	
  10.367 +export MAIN_DIALOG=" \
  10.368 +<window title=\"SSHBox\" icon-name=\"gtk-network\" resizable=^\"false\">
  10.369 + <vbox>  
  10.370 +	<hbox homogeneous=\"true\">
  10.371 +	<text  width-chars=\"60\">
  10.372 +		<label>\"\"</label>
  10.373 +	</text>
  10.374 +	</hbox>
  10.375 +	<notebook labels=\"${TITLE_MAIN:-Main}|${TITLE_SESSION:-Sessions}|${TITLE_HOST:-Host key}\">
  10.376 +	
  10.377 +	<vbox>  
  10.378 +		<hbox spacing=\"43\">
  10.379 +			<text use-markup=\"true\" >
  10.380 +				<label>\"${TXT_HOST:-Host}:\"</label>
  10.381 +			</text>
  10.382 +			<entry>
  10.383 +				<default>\"$HOSTNAME\"</default>
  10.384 +				<variable>SSH_HOST</variable>
  10.385 +			</entry>
  10.386 +		</hbox>
  10.387 +		<hbox>
  10.388 +			<text use-markup=\"true\">
  10.389 +				<label>\"${TXT_USER:-Username}:\"</label>
  10.390 +			</text>
  10.391 +			<entry>
  10.392 +				<default>\"$USERNAME\"</default>
  10.393 +				<variable>SSH_USER</variable>
  10.394 +			</entry>
  10.395 +		</hbox>
  10.396 +		<hbox  spacing=\"20\">
  10.397 +			<text use-markup=\"true\">
  10.398 +				<label>\"${TXT_KEY:-SSH Key}:\"</label>
  10.399 +			</text>
  10.400 +			<entry>
  10.401 +				<default>\"\"</default>
  10.402 +				<variable>SSH_KEY</variable>
  10.403 +			</entry>
  10.404 +		</hbox>
  10.405 +		<hbox>
  10.406 +		<button>
  10.407 +			<label>${BTN_ADD:-Save session}</label>
  10.408 +			<input file icon=\"gtk-save\"></input>
  10.409 +			<action>$PROG quick_add_session</action>
  10.410 +			<action>refresh:SESSION</action>
  10.411 +		</button>
  10.412 +		<button>
  10.413 +			<label>${BTN_CONNECT:-Connect}</label>
  10.414 +			<input file icon=\"gtk-connect\"></input>
  10.415 +			<action>$PROG ssh_connect</action>
  10.416 +		</button>
  10.417 +		</hbox>
  10.418 +	</vbox>
  10.419 +	
  10.420 +	<vbox>
  10.421 +		<hbox>
  10.422 +			<tree headers_visible=\"false\" exported_column=\"0\">
  10.423 +				<width>200</width><height>150</height>
  10.424 +				<label>\"\"</label>
  10.425 +				<variable>SESSION</variable>
  10.426 +				<input stock_column=\"0\">$PROG list_sessions</input>
  10.427 +				<action>$PROG gtk_manage_session $SESSION</action>
  10.428 +				<action>refresh:SESSION</action>
  10.429 +			</tree>
  10.430 +		</hbox>
  10.431 +		<hbox>
  10.432 +			<text width-chars=\"45\">
  10.433 +				<label>
  10.434 +\"
  10.435 +Double click on session name to manage SSH session.
  10.436 +\"
  10.437 +				</label>
  10.438 +			</text>
  10.439 +		<button>
  10.440 +			<label>${BTN_ADD_SESSION:-Add session}</label>
  10.441 +			<input file icon=\"gtk-add\"></input>
  10.442 +			<action>$PROG add_session</action>
  10.443 +			<action>refresh:SESSION</action>
  10.444 +		</button>
  10.445 +		</hbox>
  10.446 +	</vbox>
  10.447 +	
  10.448 +	<vbox>
  10.449 +		<hbox>
  10.450 +			<tree headers_visible=\"false\" exported_column=\"0\">
  10.451 +				<width>200</width><height>150</height>
  10.452 +				<label>\"\"</label>
  10.453 +				<variable>KNOWN_HOST</variable>
  10.454 +				<input>$PROG list_host</input>
  10.455 +				<action>$PROG delete_host $KNOWN_HOST</action>
  10.456 +				<action>refresh:KNOWN_HOST</action>
  10.457 +			</tree>
  10.458 +		</hbox>
  10.459 +		<hbox>
  10.460 +			<text width-chars=\"60\">
  10.461 +				<label>
  10.462 +\"Double click on host to remove it.\"
  10.463 +				</label>
  10.464 +			</text>
  10.465 +		</hbox>
  10.466 +	</vbox>
  10.467 +	</notebook> 
  10.468 +	 <hbox>
  10.469 +		<button>
  10.470 +			<label>${BTN_ABOUT:-About}</label>
  10.471 +			<input file icon=\"gtk-about\"></input>
  10.472 +			<action>$PROG gtk_about $PROGNAME</action>
  10.473 +		</button>
  10.474 +		<button>
  10.475 +			<label>${BTN_SETTINGS:-Settings}</label>
  10.476 +			<input file icon=\"gtk-preferences\"></input>
  10.477 +			<action>$0 gtk_settings</action>
  10.478 +		</button>
  10.479 +	 	<button>
  10.480 +			<label>${BTN_Exit:-Exit}</label>
  10.481 +			<input file icon=\"exit\"></input>
  10.482 +			<action type=\"exit\">Exit</action>
  10.483 +		</button>
  10.484 +	</hbox>
  10.485 + </vbox>
  10.486 +</window>
  10.487 +"
  10.488 +	gtkdialog --center --program=MAIN_DIALOG
  10.489 +}
  10.490 +
  10.491 +
  10.492 +
  10.493 +case $1 in 
  10.494 +	*_*)
  10.495 +		$1 ;;
  10.496 +	*)
  10.497 +		main_dialog	;;
  10.498 +esac
  10.499 +		
  10.500 +
  10.501 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/oldstuff/gtkdialog/sshbox.desktop	Sat Apr 28 20:21:10 2012 +0200
    11.3 @@ -0,0 +1,12 @@
    11.4 +[Desktop Entry]
    11.5 +Encoding=UTF-8
    11.6 +Name=SSHBox Secure Shell
    11.7 +Name[fr]=SSHBox Shell sécurisé
    11.8 +Name[pt]=SSHBox Shell Seguro
    11.9 +Name[pt_BR]=SSHBox Shell Seguro
   11.10 +Comment=Upload or download files with scp
   11.11 +Comment[fr]=Connexion distante sécurisée
   11.12 +Exec=sshbox
   11.13 +Icon=gtk-network
   11.14 +Type=Application
   11.15 +Categories=Application;Network;
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/oldstuff/gtkdialog/tazhw-box.desktop	Sat Apr 28 20:21:10 2012 +0200
    12.3 @@ -0,0 +1,10 @@
    12.4 +[Desktop Entry]
    12.5 +Encoding=UTF-8
    12.6 +Name=Hardware detection and drivers
    12.7 +Name[fr]=Détection du matériel et drivers
    12.8 +Name[pt]=Detecção de Hardware e Drivers
    12.9 +Name[pt_BR]=Detecção de Hardware e Drivers
   12.10 +Icon=computer
   12.11 +Exec=subox 'tazhw box'
   12.12 +Type=Application
   12.13 +Categories=System;Application;
    13.1 --- a/rootfs/usr/share/applications/desktopbox-autostart.desktop	Sat Apr 28 20:16:24 2012 +0200
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,9 +0,0 @@
    13.4 -[Desktop Entry]
    13.5 -Encoding=UTF-8
    13.6 -Name=Auto started applications
    13.7 -Name[pt]=Aplicações Auto Iniciadas
    13.8 -Name[pt_BR]=Aplicações Auto Iniciadas
    13.9 -Icon=gnome-session
   13.10 -Exec=desktopbox autostart
   13.11 -Type=Application
   13.12 -Categories=Settings;DesktopSettings;GTK;
    14.1 --- a/rootfs/usr/share/applications/desktopbox-tazapps.desktop	Sat Apr 28 20:16:24 2012 +0200
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,10 +0,0 @@
    14.4 -[Desktop Entry]
    14.5 -Encoding=UTF-8
    14.6 -Name=Favorite applications
    14.7 -Name[fr]=Applications favorites
    14.8 -Name[pt]=Aplicativos Favoritos
    14.9 -Name[pt_BR]=Aplicativos Favoritos
   14.10 -Icon=preferences-desktop
   14.11 -Exec=desktopbox tazapps
   14.12 -Type=Application
   14.13 -Categories=Settings;DesktopSettings;
    15.1 --- a/rootfs/usr/share/applications/netbox.desktop	Sat Apr 28 20:16:24 2012 +0200
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,10 +0,0 @@
    15.4 -[Desktop Entry]
    15.5 -Encoding=UTF-8
    15.6 -Name=Configure networking
    15.7 -Name[fr]=Configurer le réseau
    15.8 -Name[pt]=Configuração de Rede
    15.9 -Name[pt_BR]=Configuração de Rede
   15.10 -Exec=subox netbox
   15.11 -Icon=netbox
   15.12 -Type=Application
   15.13 -Categories=System;Application;
    16.1 --- a/rootfs/usr/share/applications/scpbox.desktop	Sat Apr 28 20:16:24 2012 +0200
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,10 +0,0 @@
    16.4 -[Desktop Entry]
    16.5 -Encoding=UTF-8
    16.6 -Name=Scpbox Secure copy
    16.7 -Name[fr]=Copie sécurisée Scpbox
    16.8 -Name[pt]=Scpbox Cópia Segura de Arquivos
    16.9 -Name[pt_BR]=Scpbox Cópia Segura de Arquivos
   16.10 -Exec=scpbox
   16.11 -Icon=folder-remote
   16.12 -Type=Application
   16.13 -Categories=Application;Network;
    17.1 --- a/rootfs/usr/share/applications/serverbox.desktop	Sat Apr 28 20:16:24 2012 +0200
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,10 +0,0 @@
    17.4 -[Desktop Entry]
    17.5 -Encoding=UTF-8
    17.6 -Name=Manage servers
    17.7 -Name[fr]=Gérer les serveurs
    17.8 -Name[pt]=Gerenciar servidores
    17.9 -Name[pt_BR]=Gerenciar servidores
   17.10 -Exec=subox serverbox
   17.11 -Icon=utilities-system-monitor
   17.12 -Type=Application
   17.13 -Categories=System;Application;
    18.1 --- a/rootfs/usr/share/applications/sshbox.desktop	Sat Apr 28 20:16:24 2012 +0200
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,12 +0,0 @@
    18.4 -[Desktop Entry]
    18.5 -Encoding=UTF-8
    18.6 -Name=SSHBox Secure Shell
    18.7 -Name[fr]=SSHBox Shell sécurisé
    18.8 -Name[pt]=SSHBox Shell Seguro
    18.9 -Name[pt_BR]=SSHBox Shell Seguro
   18.10 -Comment=Upload or download files with scp
   18.11 -Comment[fr]=Connexion distante sécurisée
   18.12 -Exec=sshbox
   18.13 -Icon=gtk-network
   18.14 -Type=Application
   18.15 -Categories=Application;Network;
    19.1 --- a/rootfs/usr/share/applications/tazhw-box.desktop	Sat Apr 28 20:16:24 2012 +0200
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,10 +0,0 @@
    19.4 -[Desktop Entry]
    19.5 -Encoding=UTF-8
    19.6 -Name=Hardware detection and drivers
    19.7 -Name[fr]=Détection du matériel et drivers
    19.8 -Name[pt]=Detecção de Hardware e Drivers
    19.9 -Name[pt_BR]=Detecção de Hardware e Drivers
   19.10 -Icon=computer
   19.11 -Exec=subox 'tazhw box'
   19.12 -Type=Application
   19.13 -Categories=System;Application;
    20.1 --- a/tinyutils/desktopbox	Sat Apr 28 20:16:24 2012 +0200
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,483 +0,0 @@
    20.4 -#! /bin/sh
    20.5 -#
    20.6 -# Multi-call script providing GTK boxes to manage a desktop following
    20.7 -# Freedesktop standards.
    20.8 -#
    20.9 -# (C) GNU gpl v3 - SliTaz GNU/Linux 2008.
   20.10 -#
   20.11 -VERSION=20090504
   20.12 -
   20.13 -# Glade XML file path and translated messages path.
   20.14 -GLADE_XML=/usr/share/slitaz/glade
   20.15 -MESSAGES=/usr/share/slitaz/messages
   20.16 -
   20.17 -# Export script path and others if needed so we can use them in 'quote'.
   20.18 -export BIN=$0
   20.19 -export AUTOSTART_SCRIPT=$HOME/.config/openbox/autostart.sh
   20.20 -
   20.21 -# Standard directories.
   20.22 -mkdir -p $HOME/Desktop $HOME/.local/share/applications
   20.23 -
   20.24 -# Get the active locale (default to English).
   20.25 -. $MESSAGES/en/desktopbox.msg
   20.26 -        test -f $MESSAGES/${LANG%.*}/desktopbox.msg && . $MESSAGES/${LANG%.*}/desktopbox.msg
   20.27 -        test -f $MESSAGES/${LANG%_*}/desktopbox.msg && . $MESSAGES/${LANG%_*}/desktopbox.msg
   20.28 -
   20.29 -
   20.30 -# Command line usage.
   20.31 -usage()
   20.32 -{
   20.33 -	echo -e "\nSliTaz Freedesktop Box - Version: $VERSION\n
   20.34 -\033[1mUsage: \033[0m `basename $0` command
   20.35 -\033[1mCommands: \033[0m\n
   20.36 -  new-folder   Create a new folder on the desktop with mkdir.
   20.37 -  new-file     Create a new empty file or SHell script on the desktop.
   20.38 -  add-icons    Add a system icon to the desktop.
   20.39 -  notify       Display a notification message (center/no decoration).
   20.40 -               Ex: `basename $0` notify \"Message to display\" 4
   20.41 -  autostart    Manage autostarted applications with Openbox.
   20.42 -  logout       Prompt for X session exit or system halt/reboot.\n"
   20.43 -}
   20.44 -
   20.45 -# Openbox autostart functions, first column is used for icons
   20.46 -autostart_list()
   20.47 -{
   20.48 -	# Enabled
   20.49 -	for app in `cat $AUTOSTART_SCRIPT | grep ^[a-z] | awk '{ print $1 }'`
   20.50 -	do
   20.51 -		comment=`grep -B 1 "^$app" $AUTOSTART_SCRIPT | grep '^# ' | sed s/'#'//`
   20.52 -		[ -x /usr/bin/$app ] && echo "go-next | $app | $comment"
   20.53 -	done
   20.54 -	# Disabled
   20.55 -	for app in `cat $AUTOSTART_SCRIPT | grep ^#[a-z] | awk '{ print $1 }'`
   20.56 -	do
   20.57 -		comment=`grep -B 1 "^$app" $AUTOSTART_SCRIPT | grep '^# ' | sed s/'#'//`
   20.58 -		app=${app#\#}
   20.59 -		[ -x /usr/bin/$app ] && echo "stop | $app | $comment"
   20.60 -	done
   20.61 -}
   20.62 -
   20.63 -# Enable or disable autostarted applications.
   20.64 -autostart_actions()
   20.65 -{
   20.66 -	if grep -q "^$APPLICATION" $AUTOSTART_SCRIPT; then
   20.67 -		sed -i s/"^$APPLICATION"/"\#$APPLICATION"/ $AUTOSTART_SCRIPT
   20.68 -	else
   20.69 -		sed -i s/"^\#$APPLICATION"/"$APPLICATION"/ $AUTOSTART_SCRIPT
   20.70 -	fi
   20.71 -}
   20.72 -
   20.73 -add_autostarted_app()
   20.74 -{
   20.75 -	if ! grep -q "^$NEW_APP" $AUTOSTART_SCRIPT; then
   20.76 -		NEW_APP=`echo $NEW_APP | sed s/'&'/''/`
   20.77 -		echo "" >> $AUTOSTART_SCRIPT
   20.78 -		echo "# $NEW_COMMENT" >> $AUTOSTART_SCRIPT
   20.79 -		echo "$NEW_APP &" >> $AUTOSTART_SCRIPT
   20.80 -	fi
   20.81 -}
   20.82 -
   20.83 -add_autostarted_app_box()
   20.84 -{
   20.85 -	export ADD_AUTO_START_BOX='
   20.86 -<window title="Add auto started applications" icon-name="preferences-system-session">
   20.87 -<vbox>
   20.88 -	<text width-chars="54">
   20.89 -		<label>"
   20.90 -Add a new application starting with your session
   20.91 -		"</label>
   20.92 -	</text>
   20.93 -	<hbox>
   20.94 -		<text>
   20.95 -			<label>"Application:"</label>
   20.96 -		</text>
   20.97 -		<entry>
   20.98 -			<variable>NEW_APP</variable>
   20.99 -		</entry>
  20.100 -	</hbox>
  20.101 -	<hbox>
  20.102 -		<text>
  20.103 -			<label>"Comment:  "</label>
  20.104 -		</text>
  20.105 -		<entry>
  20.106 -			<variable>NEW_COMMENT</variable>
  20.107 -		</entry>
  20.108 -	</hbox>
  20.109 -	<hbox>
  20.110 -		<button ok>
  20.111 -			<action>$BIN add_autostarted_app</action>
  20.112 -			<action type="exit">exit</action>
  20.113 -		</button>
  20.114 -		<button cancel></button>
  20.115 -	</hbox>
  20.116 -</vbox>
  20.117 -</window>'
  20.118 -	gtkdialog --center --program=ADD_AUTO_START_BOX
  20.119 -}
  20.120 -
  20.121 -# Box commands.
  20.122 -
  20.123 -case $1 in
  20.124 -	new-folder)
  20.125 -		# Create a directory on the ~/Desktop.
  20.126 -		#
  20.127 -		DESKTOP_DIALOG="
  20.128 -<window title=\"Desktopbox - mkdir\" icon-name=\"folder-new\">
  20.129 -<vbox>
  20.130 -
  20.131 -	<text use-markup=\"true\" width-chars=\"40\">
  20.132 -		<label>\"
  20.133 -<b>$NEW_FOLDER_LABEL</b>\"
  20.134 -		</label>
  20.135 -	</text>
  20.136 -
  20.137 -	<hbox>
  20.138 -		<entry>
  20.139 -			<default>$FOLDER_ENTRY_MSG</default>
  20.140 -			<variable>DIR</variable>
  20.141 -		</entry>
  20.142 -	</hbox>"
  20.143 -		ACTIONS='
  20.144 -	<hbox>
  20.145 -		<button>
  20.146 -			<label>Mkdir</label>
  20.147 -			<input file icon="folder-new"></input>
  20.148 -			<action>mkdir -p "$HOME/Desktop/$DIR"</action>
  20.149 -			<action type="exit">Exit</action>
  20.150 -		</button>
  20.151 -		<button cancel>
  20.152 -			<action type="exit">Exit</action>
  20.153 -		</button>
  20.154 -	</hbox>
  20.155 -
  20.156 -</vbox>
  20.157 -</window>'
  20.158 -		export DESKTOP_DIALOG="${DESKTOP_DIALOG}${ACTIONS}" ;;
  20.159 -	new-file)
  20.160 -		# Create a file on the ~/Desktop.
  20.161 -		#
  20.162 -		DESKTOP_DIALOG="
  20.163 -<window title=\"Desktopbox - touch/cat\" icon-name=\"document-new\">
  20.164 -<vbox>
  20.165 -	<text use-markup=\"true\" width-chars=\"40\">
  20.166 -		<label>\"
  20.167 -<b>$NEW_FILE_LABEL</b>\"
  20.168 -		</label>
  20.169 -	</text>
  20.170 -
  20.171 -	<hbox>
  20.172 -		<entry>
  20.173 -			<default>$FILE_ENTRY_MSG</default>
  20.174 -			<variable>FILE</variable>
  20.175 -		</entry>
  20.176 -	</hbox>"
  20.177 -		ACTIONS='
  20.178 -	<hbox>
  20.179 -		<button>
  20.180 -			<label>SH script</label>
  20.181 -			<input file icon="document-new"></input>
  20.182 -			<action>echo "#!/bin/sh" > "$HOME/Desktop/$FILE"</action>
  20.183 -			<action>echo "#" >> "$HOME/Desktop/$FILE"</action>
  20.184 -			<action>chmod +x "$HOME/Desktop/$FILE"</action>
  20.185 -			<action type="exit">Exit</action>
  20.186 -		</button>
  20.187 -		<button>
  20.188 -			<label>Empty</label>
  20.189 -			<input file icon="document-new"></input>
  20.190 -			<action>touch "$HOME/Desktop/$FILE"</action>
  20.191 -			<action type="exit">Exit</action>
  20.192 -		</button>
  20.193 -		<button cancel>
  20.194 -			<action type="exit">Exit</action>
  20.195 -		</button>
  20.196 -	</hbox>
  20.197 -</vbox>
  20.198 -</window>'
  20.199 -		export DESKTOP_DIALOG="${DESKTOP_DIALOG}${ACTIONS}" ;;
  20.200 -	add-icons)
  20.201 -		# Add new icons on the ~/Desktop from /usr/share/applications.
  20.202 -		#
  20.203 -		DESKTOP_DIALOG="
  20.204 -<window title=\"$ADD_ICON_LABEL\" icon-name=\"document-new\">
  20.205 -<vbox>
  20.206 -	<text use-markup=\"true\" width-chars=\"40\">
  20.207 -		<label>\"
  20.208 -<b>$ADD_ICON_LABEL</b>
  20.209 -\"
  20.210 -		</label>
  20.211 -	</text>
  20.212 -	<tree headers_visible=\"false\">
  20.213 -		<width>420</width><height>200</height>
  20.214 -		<variable>ICON</variable>
  20.215 -		<label>Filename|Application</label>"
  20.216 -		# Get application name and icon.
  20.217 -		cd /usr/share/applications
  20.218 -		for file in *.desktop
  20.219 -		do
  20.220 -			# Try to get the name in the right locale.
  20.221 -			NAME=`grep ^Name $file | grep $lang || grep ^Name= $file`
  20.222 -			NAME=`echo $NAME | cut -d "=" -f 2`
  20.223 -			ICON=`grep ^Icon= $file | cut -d "=" -f 2`
  20.224 -			ICON=`basename $ICON`
  20.225 -			ICON=${ICON%.*}
  20.226 -			FILE=${file%.desktop}
  20.227 -			ITEM="<item icon=\"$ICON\">$FILE | $NAME</item>"
  20.228 -			DESKTOP_DIALOG="${DESKTOP_DIALOG}${ITEM}"
  20.229 -		done
  20.230 -		ACTIONS='<action>cp /usr/share/applications/$ICON.desktop ~/Desktop</action>
  20.231 -	</tree>
  20.232 -	<hbox>
  20.233 -		<button>
  20.234 -			<label>Add</label>
  20.235 -			<input file icon="gtk-add"></input>
  20.236 -			<action>cp /usr/share/applications/$ICON.desktop ~/Desktop</action>
  20.237 -		</button>
  20.238 -		<button>
  20.239 -			<label>Exit</label>
  20.240 -			<input file icon="exit"></input>
  20.241 -			<action type="exit">Exit</action>
  20.242 -		</button>
  20.243 -	</hbox>
  20.244 -</vbox>
  20.245 -</window>'
  20.246 -		export DESKTOP_DIALOG=${DESKTOP_DIALOG}${ACTIONS} ;;
  20.247 -	logout)
  20.248 -		# X session/system logout.
  20.249 -		#
  20.250 -		DESKTOP_DIALOG="
  20.251 -<window title=\"SliTaz Desktop logout\" icon-name=\"user-desktop\" skip_taskbar_hint=\"true\">
  20.252 -<vbox>
  20.253 -	<pixmap>
  20.254 -		<input file>/usr/share/icons/Tango/32x32/places/user-desktop.png</input>
  20.255 -	</pixmap>
  20.256 -	<hbox>
  20.257 -		<text use-markup=\"true\" width-chars=\"$CHARS_SIZE\">
  20.258 -			<label>
  20.259 -\"<b>$DESKTOP_DIALOG_LABEL</b>
  20.260 -\"
  20.261 -			</label>
  20.262 -		</text>
  20.263 -	</hbox>"
  20.264 -		TAZUSB_DIALOG="
  20.265 -	<hbox>
  20.266 -		<checkbox>
  20.267 -			<label>$DESKTOP_DIALOG_TAZUSB</label>
  20.268 -			<variable>TAZUSB_WRITE</variable>
  20.269 -			<default>false</default>
  20.270 -		</checkbox>
  20.271 -		<radiobutton>
  20.272 -			<label>lzma</label>
  20.273 -			<variable>LZMA</variable>
  20.274 -		</radiobutton>
  20.275 -		<radiobutton active=\"true\">
  20.276 -			<label>gzip</label>
  20.277 -			<variable>GZIP</variable>
  20.278 -		</radiobutton>
  20.279 -		<radiobutton>
  20.280 -			<label>none</label>
  20.281 -			<variable>NONE</variable>
  20.282 -		</radiobutton>
  20.283 -	</hbox>"
  20.284 -		EXTRA="COMP=none; [ \$LZMA = true ] && COMP=lzma; [ \$GZIP = true ] && COMP=gzip; [ \$TAZUSB_WRITE = true ] && { subox \"xterm -e '/usr/bin/tazusb writefs \$COMP'\"; sleep 1; while ps x | grep -v grep | grep -q tazusb; do sleep 1; done; };"
  20.285 -		[ -f /home/boot/rootfs.gz ] || { TAZUSB_DIALOG=""; EXTRA=""; }
  20.286 -		# Logout for Openbox or JWM and system shutdown or reboot.
  20.287 -		ACTIONS="
  20.288 -	<hbox>
  20.289 -		<button>
  20.290 -			<label>$DESKTOP_LOGOUT_BUTTON</label>
  20.291 -			<input file icon=\"video-display\"></input>
  20.292 -			<action>$EXTRA openbox --exit || jwm -exit</action>
  20.293 -			<action type=\"exit\">Exit</action>
  20.294 -		</button>
  20.295 -		<button>
  20.296 -			<label>$DESKTOP_SHUTDOWN_BUTTON</label>
  20.297 -			<input file icon=\"system-shutdown\"></input>
  20.298 -			<action>$EXTRA poweroff</action>
  20.299 -			<action type=\"exit\">Exit</action>
  20.300 -		</button>
  20.301 -		<button>
  20.302 -			<label>$DESKTOP_REBOOT_BUTTON</label>
  20.303 -			<input file icon=\"reload\"></input>
  20.304 -			<action>$EXTRA reboot</action>
  20.305 -			<action type=\"exit\">Exit</action>
  20.306 -		</button>
  20.307 -		<button cancel>
  20.308 -			<action type=\"exit\">Exit</action>
  20.309 -		</button>
  20.310 -	</hbox>
  20.311 -</vbox>
  20.312 -</window>"
  20.313 -		export DESKTOP_DIALOG=${DESKTOP_DIALOG}${TAZUSB_DIALOG}${ACTIONS} ;;
  20.314 -	notify)
  20.315 -		# Notification message without window decoration.
  20.316 -		MSG="$2"
  20.317 -		SEC=$3
  20.318 -		[ -z $SEC ] && SEC=4
  20.319 -		export NOTIFY_BOX="
  20.320 -<window decorated=\"false\" skip_taskbar_hint=\"true\">
  20.321 -<vbox>
  20.322 -	<text width-chars=\"64\" use-markup=\"true\">
  20.323 -		<label>\"
  20.324 -<b>$MSG</b>
  20.325 -		\"</label>
  20.326 -	</text>
  20.327 -</vbox>
  20.328 -</window>"
  20.329 -		gtkdialog --center --program=NOTIFY_BOX >/dev/null &
  20.330 -		sleep $SEC
  20.331 -		pid=`ps | grep NOTIFY_BOX | awk '{ print $1 }'`
  20.332 -		kill $pid 2>/dev/null
  20.333 -		exit 0 ;;
  20.334 -	autostart)
  20.335 -		# Autostarted apps management. Functions are used for input 
  20.336 -		# and actions
  20.337 -		export DESKTOP_DIALOG='
  20.338 -<window title="Auto start applications with Openbox" icon-name="preferences-system-session">
  20.339 -<vbox>
  20.340 -	<tree>
  20.341 -		<width>540</width><height>200</height>
  20.342 -		<variable>APPLICATION</variable>
  20.343 -		<label>Application|Comment</label>
  20.344 -		<input icon_column="0">$BIN autostart_list</input>
  20.345 -		<action>$BIN autostart_actions</action>
  20.346 -		<action>refresh:APPLICATION</action>
  20.347 -	</tree>
  20.348 -	<hbox>
  20.349 -		<text width-chars="36">
  20.350 -				<label>
  20.351 -"Double click to enable/disable an application"
  20.352 -				</label>
  20.353 -			</text>
  20.354 -		<button>
  20.355 -			<label>Add</label>
  20.356 -			<input file icon="gtk-add"></input>
  20.357 -			<action>$BIN add_autostarted_app_box</action>
  20.358 -			<action>refresh:APPLICATION</action>
  20.359 -		</button>
  20.360 -		<button>
  20.361 -			<label>Configuration</label>
  20.362 -			<input file icon="accessories-text-editor"></input>
  20.363 -			<action>editor $AUTOSTART_SCRIPT</action>
  20.364 -			<action>refresh:APPLICATION</action>
  20.365 -		</button>
  20.366 -		<button>
  20.367 -			<label>Exit</label>
  20.368 -			<input file icon="exit"></input>	
  20.369 -			<action type="exit">exit</action>
  20.370 -		</button>
  20.371 -	</hbox>
  20.372 -</vbox>
  20.373 -</window>'
  20.374 -		;;
  20.375 -	tazapps)
  20.376 -		# Default applications configuration script. System wide config file
  20.377 -		# is /etc/slitaz/applications.conf and each user can have personal
  20.378 -		# settings. System wide for root and personal config for user.
  20.379 -		export CONFIG="$HOME/.config/slitaz/applications.conf"
  20.380 -		if [ ! -f $CONFIG ]; then
  20.381 -			mkdir -p $HOME/.config/slitaz
  20.382 -			cp /etc/slitaz/applications.conf $CONFIG
  20.383 -		fi
  20.384 -		export DESKTOP_DIALOG='
  20.385 -<window title="SliTaz default applications" icon-name="preferences-desktop">
  20.386 -<vbox>
  20.387 -	<vbox>
  20.388 -		<text use-markup="true" width-chars="54">
  20.389 -			<label>"
  20.390 -<b>SliTaz default applications configuration</b>
  20.391 -			"</label>
  20.392 -		</text>
  20.393 -	</vbox>
  20.394 -	<hbox>
  20.395 -		<text wrap="false">
  20.396 -			<label>"File manager:       "</label>
  20.397 -		</text>
  20.398 -		<entry>
  20.399 -			<input>. $CONFIG; echo $FILE_MANAGER</input>
  20.400 -			<variable>FILE_MANAGER</variable>
  20.401 -		</entry>
  20.402 -		<button>
  20.403 -			<label>Change</label>
  20.404 -			<input file icon="forward"></input>
  20.405 -			<action>sed -i s/"FILE_MANAGER=.*"/"FILE_MANAGER=\"$FILE_MANAGER\""/ $CONFIG</action>
  20.406 -		</button>
  20.407 -	</hbox>
  20.408 -	<hbox>
  20.409 -		<text wrap="false">
  20.410 -			<label>"Web browser:      "</label>
  20.411 -		</text>
  20.412 -		<entry>
  20.413 -			<input>. $CONFIG; echo $BROWSER</input>
  20.414 -			<variable>BROWSER</variable>
  20.415 -		</entry>
  20.416 -		<button>
  20.417 -			<label>Change</label>
  20.418 -			<input file icon="forward"></input>
  20.419 -			<action>sed -i s/"BROWSER=.*"/"BROWSER=\"$BROWSER\""/ $CONFIG</action>
  20.420 -		</button>
  20.421 -	</hbox>
  20.422 -	<hbox>
  20.423 -		<text wrap="false">
  20.424 -			<label>"Text editor:          "</label>
  20.425 -		</text>
  20.426 -		<entry>
  20.427 -			<input>. $CONFIG; echo $EDITOR</input>
  20.428 -			<variable>EDITOR</variable>
  20.429 -		</entry>
  20.430 -		<button>
  20.431 -			<label>Change</label>
  20.432 -			<input file icon="forward"></input>
  20.433 -			<action>sed -i s/"EDITOR=.*"/"EDITOR=\"$EDITOR\""/ $CONFIG</action>
  20.434 -		</button>
  20.435 -	</hbox>
  20.436 -	<hbox>
  20.437 -		<text wrap="false">
  20.438 -			<label>"Terminal:              "</label>
  20.439 -		</text>
  20.440 -		<entry>
  20.441 -			<input>. $CONFIG; echo $TERMINAL</input>
  20.442 -			<variable>TERMINAL</variable>
  20.443 -		</entry>
  20.444 -		<button>
  20.445 -			<label>Change</label>
  20.446 -			<input file icon="forward"></input>
  20.447 -			<action>sed -i s/"TERMINAL=.*"/"TERMINAL=\"$TERMINAL\""/ $CONFIG</action>
  20.448 -		</button>
  20.449 -	</hbox>
  20.450 -	<hbox>
  20.451 -		<text wrap="false">
  20.452 -			<label>"Window manager:"</label>
  20.453 -		</text>
  20.454 -		<entry>
  20.455 -			<input>. $CONFIG; echo $WINDOW_MANAGER</input>
  20.456 -			<variable>WINDOW_MANAGER</variable>
  20.457 -		</entry>
  20.458 -		<button>
  20.459 -			<label>Change</label>
  20.460 -			<input file icon="forward"></input>
  20.461 -			<action>sed -i s/"WINDOW_MANAGER=.*"/"WINDOW_MANAGER=\"$WINDOW_MANAGER\""/ $CONFIG</action>
  20.462 -		</button>
  20.463 -	</hbox>
  20.464 -	<hbox>
  20.465 -		<button>
  20.466 -			<label>Exit</label>
  20.467 -			<input file icon="exit"></input>	
  20.468 -			<action type="exit">exit</action>
  20.469 -		</button>
  20.470 -	</hbox>
  20.471 -</vbox>
  20.472 -</window>' ;;
  20.473 -	*_*)
  20.474 -		# Exec all function called by args (must have an underscore).
  20.475 -		$1
  20.476 -		exit 0 ;;
  20.477 -	*)
  20.478 -		# Usage if executed from cmdline.
  20.479 -		#
  20.480 -		usage
  20.481 -		exit 0 ;;
  20.482 -esac
  20.483 -
  20.484 -gtkdialog --center --program=DESKTOP_DIALOG >/dev/null
  20.485 -
  20.486 -exit 0
    21.1 --- a/tinyutils/netbox	Sat Apr 28 20:16:24 2012 +0200
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,1092 +0,0 @@
    21.4 -#!/bin/sh
    21.5 -#
    21.6 -# Gtkdialog box to manage network connections and servers.
    21.7 -# Please use tab to indent.
    21.8 -#
    21.9 -# (c) - SliTaz GNU/Linux 2009.
   21.10 -#
   21.11 -VERSION=20100315
   21.12 -
   21.13 -. /usr/lib/slitaz/gui_functions
   21.14 -
   21.15 -# Check if user is root.
   21.16 -check_root()
   21.17 -{
   21.18 -	if test $(id -u) != 0 ; then
   21.19 -		echo -e "
   21.20 -You must be root to run `basename $0`. Please type 'su' and
   21.21 -root password to become super-user.\n"
   21.22 -		exit 0
   21.23 -	fi
   21.24 -}
   21.25 -
   21.26 -
   21.27 -#
   21.28 -# Functions called by the connection tab to list interfaces.
   21.29 -#
   21.30 -############################################################
   21.31 -
   21.32 -interface_status()
   21.33 -{
   21.34 -	if 	ifconfig | grep -A 1 $i | grep -q inet; then
   21.35 -		ip=`ifconfig | grep -A 1 $i | grep inet | awk '{ print $2 }' | cut -d ":" -f 2`
   21.36 -		echo "connected ($ip)"
   21.37 -	else
   21.38 -		echo "-"
   21.39 -	fi
   21.40 -}
   21.41 -# First column is for icon name.
   21.42 -detect_interfaces()
   21.43 -{
   21.44 -	for i in `ls /sys/class/net`
   21.45 -	do
   21.46 -		case $i in
   21.47 -			eth*)
   21.48 -				echo "network-wired | $i | Ethernet | `interface_status`" ;;
   21.49 -			wlan*|ath*|ra*)
   21.50 -				echo "network-wireless | $i | Wireless | `interface_status`" ;;
   21.51 -			lo)
   21.52 -				echo "gtk-network | $i | Loopback | `interface_status`" ;;
   21.53 -			*)
   21.54 -				continue ;;
   21.55 -		esac
   21.56 -	done
   21.57 -}
   21.58 -
   21.59 -# When users double click on a connection.
   21.60 -interfaces_List_actions()
   21.61 -{
   21.62 -	echo "$INTERFACE_LIST"
   21.63 -}
   21.64 -
   21.65 -# Netbox can be called with args.
   21.66 -case "$1" in
   21.67 -	detect_interfaces|interfaces_List_actions)
   21.68 -		$1
   21.69 -		exit 0 ;;
   21.70 -	*)
   21.71 -		continue ;;
   21.72 -esac
   21.73 -
   21.74 -set_ipup()
   21.75 -{
   21.76 -	[ -f /etc/ppp/ip-up ] && return
   21.77 -	cat > /etc/ppp/ip-up <<EOT
   21.78 -#!/bin/sh
   21.79 -exec $0 call ipup \$@
   21.80 -EOT
   21.81 -	chmod +x /etc/ppp/ip-up
   21.82 -}
   21.83 -
   21.84 -while true; do
   21.85 -
   21.86 -# Detect WIFI_INTERFACE and update /etc/network.conf
   21.87 -. /etc/network.conf
   21.88 -if [ ! -d /sys/class/net/$WIFI_INTERFACE/wireless ]; then
   21.89 -	WIFI_INTERFACE=$(for i in /sys/class/net/*/wireless; do \
   21.90 -		[ -d $i ] && echo $(basename $(dirname $i)) || echo wlan0; \
   21.91 -		break; done)
   21.92 -	[ -n "$WIFI_INTERFACE" ] && sed -i "s/^WIFI_INTERFACE=.*/WIFI_INTERFACE=\"$WIFI_INTERFACE\"/" /etc/network.conf
   21.93 -fi
   21.94 -
   21.95 -#
   21.96 -# Netbox internal calls
   21.97 -#
   21.98 -#########################################################
   21.99 -
  21.100 -if [ "$1" = "call" ]; then
  21.101 -	ppp="pppd local lock notty"
  21.102 -	pppup=""
  21.103 -	sub=$2
  21.104 -	shift 2
  21.105 -	case "$sub" in
  21.106 -	sendsshkey)
  21.107 -		check_root
  21.108 -		( dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key ;
  21.109 -		  cat /etc/ssh/ssh_host_rsa_key.pub ) 2> /dev/null | \
  21.110 -		grep ^ssh | ssh $1 "mkdir .ssh 2> /dev/null ; \
  21.111 -while read key; do for i in authorized_keys authorized_keys2; do \
  21.112 -grep -qs '\$key' .ssh/\$i || echo '\$key' >> .ssh/\$i ; done ; done ; \
  21.113 -chmod 700 .ssh ; chmod 600 .ssh/authorized_keys*"
  21.114 -		exit 0;;
  21.115 -# OpenSSH VPN:
  21.116 -#   PermitTunnel=point-to-point   (or yes, ethernet, no)
  21.117 -#   Tunnel="4" => tun4
  21.118 -#   Local Client:
  21.119 -#     # ssh -f -w 0:1 $REMOTE true  => local tun0 [, remote tun1]
  21.120 -#     # ifconfig $TUN $IP1 $IP2 netmask 255.255.255.252
  21.121 -#     # route add $REMOTE_NETWORK $IP2
  21.122 -#   Remote Server:
  21.123 -#     # ifconfig $TUN $IP2 $IP1 netmask 255.255.255.252
  21.124 -#     # route add $LOCAL_NETWORK $IP1
  21.125 -	vpnssh)	check_root
  21.126 -		set_ipup
  21.127 -		ps ww | grep -q "$ppp $2:$3" && exit 1
  21.128 -		pipe="/tmp/ssh$$"
  21.129 -		mkfifo $pipe
  21.130 -		[ -n "$4" ] && pppup="ipparam 'addroutes,$(echo $4 | sed 's/ /,/g')'"
  21.131 -		cat $pipe | dbclient -i /etc/dropbear/dropbear_rsa_host_key \
  21.132 -		$1 "$ppp" | $ppp $2:$3 $pppup > $pipe
  21.133 -		rm -f $pipe
  21.134 -		exit 0;;
  21.135 -	killvpnssh)
  21.136 -		check_root
  21.137 -		kill $(ps x | grep dbclient | grep "$ppp" | awk '{ print $1 }')
  21.138 -		exit 0;;
  21.139 -	ipup)
  21.140 -#    Arg  Name                          Example
  21.141 -#    $1   Interface name                ppp0
  21.142 -#    $2   The tty                       ttyS1
  21.143 -#    $3   The link speed                38400
  21.144 -#    $4   Local IP number               12.34.56.78
  21.145 -#    $5   Peer  IP number               12.34.56.99
  21.146 -#    $6   Optional ``ipparam'' value    foo
  21.147 -		iface=$1
  21.148 -		# skip tty if present
  21.149 -		case "$2" in [0-9]*);; *) shift; esac
  21.150 -		peer=$4
  21.151 -		IFS=","; set -- $(eval echo $5); unset IFS
  21.152 -		set -- $1
  21.153 -		if [ "$1" = "addroutes" ]; then
  21.154 -			while [ -n "$2" ]; do
  21.155 -				eval $(ipcalc -n $2)
  21.156 -				eval $(ipcalc -m $2)
  21.157 -				route add -net $NETWORK netmask $NETMASK \
  21.158 -					gw $peer $iface
  21.159 -				shift
  21.160 -			done
  21.161 -		fi
  21.162 -		exit 0;;
  21.163 -	esac
  21.164 -	echo "call $sub unsupported."
  21.165 -	exit 1
  21.166 -fi
  21.167 -
  21.168 -
  21.169 -
  21.170 -#
  21.171 -# Status wire interfaces
  21.172 -#
  21.173 -tab_status_iface()
  21.174 -{
  21.175 -local eth
  21.176 -eth="$( (cd /sys/class/net ; [ -d eth0 ] && ls -d eth* ) )"
  21.177 -which ethtool > /dev/null || eth=''
  21.178 -if [ -n "$eth" ]; then
  21.179 -    cat <<EOT
  21.180 -<notebook labels="Ifconfig|$(echo $eth | sed 's/ /|/g')">
  21.181 -EOT
  21.182 -fi
  21.183 -cat <<EOT
  21.184 -<frame Ifconfig>
  21.185 -	<text wrap="false" width-chars="58">
  21.186 -		<input>ifconfig</input>
  21.187 -	</text>
  21.188 -</frame>
  21.189 -EOT
  21.190 -if [ -n "$eth" ]; then
  21.191 -    local i
  21.192 -    for i in $eth ; do
  21.193 -        cat <<EOT
  21.194 -<frame $i>
  21.195 -	<text wrap="false" width-chars="58">
  21.196 -		<input>ethtool $i</input>
  21.197 -	</text>
  21.198 -</frame>
  21.199 -EOT
  21.200 -    done
  21.201 -    cat <<EOT
  21.202 -</notebook>
  21.203 -EOT
  21.204 -fi
  21.205 -}
  21.206 -
  21.207 -#
  21.208 -# Status wifi interfaces
  21.209 -#
  21.210 -tab_status_wifi_iface()
  21.211 -{
  21.212 -cat <<EOT
  21.213 -<frame Iwconfig>
  21.214 -	<text wrap="false" width-chars="58">
  21.215 -		<input>iwconfig</input>
  21.216 -	</text>
  21.217 -</frame>
  21.218 -EOT
  21.219 -}
  21.220 -
  21.221 -#
  21.222 -# Status wifi network
  21.223 -#
  21.224 -tab_status_wifi_net()
  21.225 -{
  21.226 -cat <<EOT
  21.227 -<frame Wireless networks>
  21.228 -	<text wrap="false" width-chars="58">
  21.229 -		<input>iwlist scan</input>
  21.230 -	</text>
  21.231 -</frame>
  21.232 -EOT
  21.233 -}
  21.234 -
  21.235 -#
  21.236 -# Status routing
  21.237 -#
  21.238 -tab_status_route()
  21.239 -{
  21.240 -cat <<EOT
  21.241 -<frame Routing>
  21.242 -	<frame Nameservers>
  21.243 -		<text wrap="false" width-chars="58">
  21.244 -			<input>cat /etc/resolv.conf</input>
  21.245 -		</text>
  21.246 -	</frame>
  21.247 -	<frame Routing table>
  21.248 -		<text wrap="false" width-chars="58">
  21.249 -			<input>route</input>
  21.250 -		</text>
  21.251 -	</frame>
  21.252 -	<frame Arp table>
  21.253 -		<text wrap="false" width-chars="58">
  21.254 -			<input>arp</input>
  21.255 -		</text>
  21.256 -	</frame>
  21.257 -</frame>
  21.258 -EOT
  21.259 -}
  21.260 -
  21.261 -data_status()
  21.262 -{
  21.263 -cat <<EOT
  21.264 -ifconfig    Network\ interfaces   tab_status_iface
  21.265 -iwconfig    Wireless\ interfaces  tab_status_wifi_iface
  21.266 -iwlist      Wireless\ networks    tab_status_wifi_net
  21.267 -route       Routing               tab_status_route
  21.268 -EOT
  21.269 -}
  21.270 -
  21.271 -#
  21.272 -# Status
  21.273 -#
  21.274 -tab_status()
  21.275 -{
  21.276 -use_tab data_status
  21.277 -}
  21.278 -
  21.279 -#
  21.280 -# Interfaces list from detect_interfaces()
  21.281 -#
  21.282 -tab_connections()
  21.283 -{
  21.284 -cat <<EOT
  21.285 -	<vbox>
  21.286 -		<tree>
  21.287 -			<width>520</width><height>120</height>
  21.288 -			<variable>INTERFACE_LIST</variable>
  21.289 -			<label>Interface|Type|Status</label>
  21.290 -			<input icon_column="0">$0 detect_interfaces</input>
  21.291 -			<action>refresh:INTERFACE_LIST</action>
  21.292 -		</tree>
  21.293 -	</vbox>
  21.294 -EOT
  21.295 -}
  21.296 -
  21.297 -#
  21.298 -# DHCP
  21.299 -#
  21.300 -tab_udhcpc()
  21.301 -{
  21.302 -cat <<EOT
  21.303 -<frame Udhcpc (busybox)>
  21.304 -	<text width-chars="58">
  21.305 -		<label> "Ethernet (cable) default connection." </label>
  21.306 -	</text>
  21.307 -	<hbox>
  21.308 -		<text use-markup="true">
  21.309 -			<label>"<b>Interface:</b>"</label>
  21.310 -		</text>
  21.311 -		<entry>
  21.312 -			<input>. /etc/network.conf; echo "\$INTERFACE"</input>
  21.313 -			<variable>INTERFACE</variable>
  21.314 -		</entry>
  21.315 -	</hbox>
  21.316 -	<hbox>
  21.317 -		<text use-markup="true">
  21.318 -			<label>"<b>Options:  </b>"</label>
  21.319 -		</text>
  21.320 -		<entry>
  21.321 -			<default>-b</default>
  21.322 -			<variable>UDHCPC_OPTS</variable>
  21.323 -		</entry>
  21.324 -$(helpbutton udhcpc 80x30)
  21.325 -	</hbox>
  21.326 -	<hbox>
  21.327 -		<text use-markup="true">
  21.328 -			<label>"<b>Script:     </b>"</label>
  21.329 -		</text>
  21.330 -		<entry editable="false">
  21.331 -			<default>/usr/share/udhcpc/default.script</default>
  21.332 -			<variable>UDHCPC_SCRIPT</variable>
  21.333 -		</entry>
  21.334 -$(editbutton \$UDHCPC_SCRIPT)
  21.335 -	</hbox>
  21.336 -	<hbox>
  21.337 -		<button>
  21.338 -			<label>Start</label>
  21.339 -			<input file icon="forward"></input>
  21.340 -			<action>sed -i s/^INTERFACE=.*/INTERFACE=\"\$INTERFACE\"/ /etc/network.conf</action>
  21.341 -			<action>sed -i s/^DHCP=.*/DHCP=\"yes\"/ /etc/network.conf</action>
  21.342 -			<action>sed -i s/^STATIC=.*/STATIC=\"no\"/ /etc/network.conf</action>
  21.343 -			<action>udhcpc \$UDHCPC_OPTS -i \$INTERFACE -p /var/run/udhcpc.\$INTERFACE.pid</action>
  21.344 -			<action>refresh:INTERFACE_LIST</action>
  21.345 -		</button>
  21.346 -		<button>
  21.347 -			<label>Stop</label>
  21.348 -			<input file icon="stop"></input>
  21.349 -			<action>echo -n "Stopping interface : \$INTERFACE... "</action>
  21.350 -			<action>ifconfig \$INTERFACE down</action>
  21.351 -			<action>killall -q udhcpc; echo "done"</action>
  21.352 -			<action>refresh:INTERFACE_LIST</action>
  21.353 -		</button>
  21.354 -	</hbox>
  21.355 -</frame>
  21.356 -EOT
  21.357 -}
  21.358 -
  21.359 -#
  21.360 -# Static/fixed IP settings.
  21.361 -#
  21.362 -tab_fixed_ip()
  21.363 -{
  21.364 -cat <<EOT
  21.365 -<frame Ethernet fixed IP>
  21.366 -	<hbox>
  21.367 -		<text use-markup="true">
  21.368 -			<label>"<b>Interface:   </b>"</label>
  21.369 -		</text>
  21.370 -		<entry>
  21.371 -			<input>. /etc/network.conf; echo "\$INTERFACE"</input>
  21.372 -			<variable>INTERFACE</variable>
  21.373 -		</entry>
  21.374 -	</hbox>
  21.375 -	<hbox>
  21.376 -		<text use-markup="true">
  21.377 -			<label>"<b>IP:                </b>"</label>
  21.378 -		</text>
  21.379 -		<entry>
  21.380 -			<input>. /etc/network.conf; echo "\$IP"</input>
  21.381 -			<variable>IP</variable>
  21.382 -		</entry>
  21.383 -	</hbox>
  21.384 -	<hbox>
  21.385 -		<text use-markup="true">
  21.386 -			<label>"<b>Netmask:    </b>"</label>
  21.387 -		</text>
  21.388 -		<entry>
  21.389 -			<input>. /etc/network.conf; echo "\$NETMASK"</input>
  21.390 -			<variable>NETMASK</variable>
  21.391 -		</entry>
  21.392 -	</hbox>
  21.393 -	<hbox>
  21.394 -		<text use-markup="true">
  21.395 -			<label>"<b>Gateway:    </b>"</label>
  21.396 -		</text>
  21.397 -		<entry>
  21.398 -			<input>. /etc/network.conf; echo "\$GATEWAY"</input>
  21.399 -			<variable>GATEWAY</variable>
  21.400 -		</entry>
  21.401 -	</hbox>
  21.402 -	<hbox>
  21.403 -		<text use-markup="true">
  21.404 -			<label>"<b>DNS server: </b>"</label>
  21.405 -		</text>
  21.406 -		<entry>
  21.407 -			<input>. /etc/network.conf; echo "\$DNS_SERVER"</input>
  21.408 -			<variable>DNS_SERVER</variable>
  21.409 -		</entry>
  21.410 -	</hbox>
  21.411 -	<hbox>
  21.412 -		<button>
  21.413 -		<label>Start</label>
  21.414 -			<input file icon="forward"></input>
  21.415 -			<action>ifconfig lo down</action>
  21.416 -			<action>ifconfig \$INTERFACE down</action>
  21.417 -			<action>sed -i s/^INTERFACE=.*/INTERFACE=\"\$INTERFACE\"/ /etc/network.conf</action>
  21.418 -			<action>sed -i s/^DHCP=.*/DHCP=\"no\"/ /etc/network.conf</action>
  21.419 -			<action>sed -i s/^WIFI=.*/WIFI=\"no\"/ /etc/network.conf</action>
  21.420 -			<action>sed -i s/^STATIC=.*/STATIC=\"yes\"/ /etc/network.conf</action>
  21.421 -			<action>sed -i s/^IP=.*/IP=\"\$IP\"/ /etc/network.conf</action>
  21.422 -			<action>sed -i s/^NETMASK=.*/NETMASK=\"\$NETMASK\"/ /etc/network.conf</action>
  21.423 -			<action>sed -i s/^GATEWAY=.*/GATEWAY=\"\$GATEWAY\"/ /etc/network.conf</action>
  21.424 -			<action>sed -i s/^DNS_SERVER=.*/DNS_SERVER=\"\$DNS_SERVER\"/ /etc/network.conf</action>
  21.425 -			<action>/etc/init.d/network.sh</action>
  21.426 -			<action>refresh:INTERFACE_LIST</action>
  21.427 -		</button>
  21.428 -		<button>
  21.429 -			<label>Stop</label>
  21.430 -			<input file icon="stop"></input>
  21.431 -			<action>ifconfig \$INTERFACE down</action>
  21.432 -			<action>refresh:INTERFACE_LIST</action>
  21.433 -		</button>
  21.434 -	</hbox>
  21.435 -</frame>
  21.436 -EOT
  21.437 -}
  21.438 -
  21.439 -#
  21.440 -# PPPoE settings.
  21.441 -#
  21.442 -tab_pppoe()
  21.443 -{
  21.444 -cat <<EOT
  21.445 -<frame PPPoE>
  21.446 -	<hbox>
  21.447 -		<text use-markup="true">
  21.448 -			<label>"<b>Username:</b>"</label>
  21.449 -		</text>
  21.450 -		<entry>
  21.451 -			<input>PPoE_ID=\$(grep -s ^name /etc/ppp/options); echo "\${PPoE_ID#* }"</input>
  21.452 -			<variable>PPoE_ID</variable>
  21.453 -		</entry>
  21.454 -	</hbox>
  21.455 -	<hbox>
  21.456 -		<text use-markup="true">
  21.457 -			<label>"<b>Password:</b>"</label>
  21.458 -		</text>
  21.459 -		<entry>
  21.460 -			<input>PPoE_PASS=\$(ID=\$(awk '/^name/{print \$2}' /etc/ppp/options) ; \
  21.461 -				awk -v KEY="\$ID" '\$1==KEY{print \$3}' /etc/ppp/pap-secrets); \
  21.462 -				echo "\$PPoE_PASS"</input>
  21.463 -			<variable>PPoE_PASS</variable>
  21.464 -		</entry>
  21.465 -	</hbox>
  21.466 -	<hbox>
  21.467 -$(helpbutton pppd 80x30)
  21.468 -$(manbutton 8 pppd)
  21.469 -$(webbutton ppp)
  21.470 -		<button>
  21.471 -			<input file icon="accessories-text-editor"></input>
  21.472 -			<label>Tune</label>
  21.473 -			<action>[ -n "\$PPoE_ID" ] && sed -i 's/^name .*/name \$PPoE_ID/' /etc/ppp/options</action>
  21.474 -			<action type="lauch">leafpad /etc/ppp/options</action>
  21.475 -		</button>
  21.476 -		<button>
  21.477 -			<label>Start</label>
  21.478 -			<input file icon="forward"></input>
  21.479 -			<action>[ -n "\$PPoE_ID" ] && grep -qs "^\$PPoE_ID" /etc/ppp/pap-secrets \
  21.480 -				|| echo "\$PPoE_ID	*	\$PPoE_PASS" >> /etc/ppp/pap-secrets</action>
  21.481 -			<action>[ -n "\$PPoE_ID" ] && grep -qs "^\$PPoE_ID" /etc/ppp/chap-secrets \
  21.482 -				|| echo "\$PPoE_ID	*	\$PPoE_PASS" >> /etc/ppp/chap-secrets</action> 
  21.483 -			<action>[ -n "\$PPoE_ID" ] && sed -i "s/^name .*/name \$PPoE_ID/" /etc/ppp/options</action>
  21.484 -			<action>killall udhcpc</action>
  21.485 -			<action>sed -i 's/DHCP=.*/DHCP="no"/' /etc/network.conf</action>
  21.486 -			<action>sed -i 's/PPPOE=.*/PPPOE="yes"/' /etc/network.conf</action>
  21.487 -			<action>. /etc/network.conf ; pppd \$INTERFACE &</action>
  21.488 -		</button>
  21.489 -		<button>
  21.490 -			<label>Stop</label>
  21.491 -			<input file icon="stop"></input>
  21.492 -			<action>sed -i 's/PPPOE=.*/PPPOE="no"/' /etc/network.conf</action>
  21.493 -			<action>killall pppd</action>
  21.494 -		</button>
  21.495 -	</hbox>
  21.496 -</frame>
  21.497 -EOT
  21.498 -}
  21.499 -
  21.500 -#
  21.501 -# PPP settings.
  21.502 -#
  21.503 -tab_ppp()
  21.504 -{
  21.505 -cat <<EOT
  21.506 -<frame PPP>
  21.507 -	<hbox>
  21.508 -		<text use-markup="true">
  21.509 -			<label>"<b>Username: </b>"</label>
  21.510 -		</text>
  21.511 -		<entry>
  21.512 -			<input>NAME=\$(grep -s ^ACCOUNT= /etc/ppp/scripts/ppp-on | cut -f1); echo "\${NAME#*=}"</input>
  21.513 -			<variable>NAME</variable>
  21.514 -		</entry>
  21.515 -	</hbox>
  21.516 -	<hbox>
  21.517 -		<text use-markup="true">
  21.518 -			<label>"<b>Password: </b>"</label>
  21.519 -		</text>
  21.520 -		<entry>
  21.521 -			<input>PASS=\$(grep -s ^PASSWORD= /etc/ppp/scripts/ppp-on | cut -f1); echo "\${PASS#*=}"</input>
  21.522 -			<variable>PASS</variable>
  21.523 -		</entry>
  21.524 -	</hbox>
  21.525 -	<hbox>
  21.526 -		<text use-markup="true">
  21.527 -			<label>"<b>Telephone:</b>"</label>
  21.528 -		</text>
  21.529 -		<entry>
  21.530 -			<input>PHONE=\$(grep -s ^TELEPHONE= /etc/ppp/scripts/ppp-on | cut -f1); echo "\${PHONE#*=}"</input>
  21.531 -			<variable>PHONE</variable>
  21.532 -		</entry>
  21.533 -	</hbox>
  21.534 -	<hbox>
  21.535 -$(helpbutton pppd 80x30)
  21.536 -$(manbutton 8 pppd)
  21.537 -$(webbutton ppp)
  21.538 -		<button>
  21.539 -			<input file icon="accessories-text-editor"></input>
  21.540 -			<label>Tune</label>
  21.541 -			<action>[ -n "\$NAME" ] && sed -i "s/^ACCOUNT=.*/ACCOUNT=\$NAME/" /etc/ppp/scripts/ppp-on</action>
  21.542 -			<action>[ -n "\$PASS" ] && sed -i "s/^PASSWORD=.*/PASSWORD=\$PASS/" /etc/ppp/scripts/ppp-on</action>
  21.543 -			<action>[ -n "\$PHONE" ] && sed -i "s/^TELEPHONE=.*/TELEPHONE=\$PHONE/" /etc/ppp/scripts/ppp-on</action>
  21.544 -			<action type="lauch">leafpad /etc/ppp/scripts/ppp-on</action>
  21.545 -		</button>
  21.546 -		<button>
  21.547 -			<label>Start</label>
  21.548 -			<input file icon="forward"></input>
  21.549 -			<action>[ -n "\$NAME" ] && grep -qs "^\$NAME" /etc/ppp/pap-secrets \
  21.550 -				|| echo "\$NAME	*	\$PASS" >> /etc/ppp/pap-secrets</action>
  21.551 -			<action>[ -n "\$NAME" ] && grep -qs "^\$NAME" /etc/ppp/chap-secrets \
  21.552 -				|| echo "\$NAME	*	\$PASS" >> /etc/ppp/chap-secrets</action>
  21.553 -			<action>[ -n "\$NAME" ] && sed -i "s/^name .*/name \$NAME/" /etc/ppp/options</action>
  21.554 -			<action>/etc/ppp/scripts/ppp-off</action>
  21.555 -			<action>/etc/ppp/scripts/ppp-on &</action>
  21.556 -		</button>
  21.557 -		<button>
  21.558 -			<label>Stop</label>
  21.559 -			<input file icon="stop"></input>
  21.560 -			<action>/etc/ppp/scripts/ppp-off</action>
  21.561 -		</button>
  21.562 -	</hbox>
  21.563 -</frame>
  21.564 -EOT
  21.565 -}
  21.566 -
  21.567 -#
  21.568 -# System Wide configuration.
  21.569 -#
  21.570 -tab_system()
  21.571 -{
  21.572 -cat <<EOT
  21.573 -<frame Configuration files>
  21.574 -      <hbox>
  21.575 -        <text use-markup="true">
  21.576 -          <label>"<b>Hosts            :</b>"</label>
  21.577 -        </text>
  21.578 -        <entry editable="false">
  21.579 -          <default>/etc/hosts</default>
  21.580 -          <variable>HOSTS</variable>
  21.581 -        </entry>
  21.582 -$(editbutton \$HOSTS)
  21.583 -      </hbox>
  21.584 -      <hbox>
  21.585 -        <text use-markup="true">
  21.586 -          <label>"<b>Host name    :</b>"</label>
  21.587 -        </text>
  21.588 -        <entry editable="false">
  21.589 -          <default>/etc/hostname</default>
  21.590 -          <variable>HOSTNAME</variable>
  21.591 -        </entry>
  21.592 -$(editbutton \$HOSTNAME)
  21.593 -      </hbox>
  21.594 -      <hbox>
  21.595 -        <text use-markup="true">
  21.596 -          <label>"<b>Network       :</b>"</label>
  21.597 -        </text>
  21.598 -        <entry editable="false">
  21.599 -          <default>/etc/network.conf</default>
  21.600 -          <variable>CONFIG_FILE</variable>
  21.601 -        </entry>
  21.602 -$(editbutton \$CONFIG_FILE)
  21.603 -      </hbox>
  21.604 -      <hbox>
  21.605 -        <button>
  21.606 -          <label>Restart</label>
  21.607 -          <input file icon="reload"></input>
  21.608 -          <action>echo -n "Stopping interface : \$INTERFACE... "</action>
  21.609 -          <action>ifconfig \$INTERFACE down</action>
  21.610 -          <action>killall -q udhcpc; echo "done"</action>
  21.611 -          <action>/etc/init.d/network.sh restart</action>
  21.612 -        </button>
  21.613 -      </hbox>
  21.614 -</frame>
  21.615 -EOT
  21.616 -}
  21.617 -
  21.618 -#
  21.619 -# ssh/ppp
  21.620 -#
  21.621 -tab_sshppp()
  21.622 -{
  21.623 -cat <<EOT
  21.624 -    <frame Virtual Private Network with PPP/SSH>
  21.625 -      <hbox>
  21.626 -        <text use-markup="true">
  21.627 -          <label>"<b>Peer          :</b>"</label>
  21.628 -        </text>
  21.629 -        <entry>
  21.630 -          <variable>DROPBEAR_PEERVPN</variable>
  21.631 -	  <default>user@elsewhere</default>
  21.632 -        </entry>
  21.633 -      </hbox>
  21.634 -      <hbox>
  21.635 -        <text use-markup="true">
  21.636 -          <label>"<b>Local IP     :</b>"</label>
  21.637 -        </text>
  21.638 -        <entry>
  21.639 -          <variable>DROPBEAR_LOCAL</variable>
  21.640 -	  <default>192.168.254.1</default>
  21.641 -        </entry>
  21.642 -      </hbox>
  21.643 -      <hbox>
  21.644 -        <text use-markup="true">
  21.645 -          <label>"<b>Remote IP :</b>"</label>
  21.646 -        </text>
  21.647 -        <entry>
  21.648 -          <variable>DROPBEAR_REMOTE</variable>
  21.649 -	  <default>192.168.254.2</default>
  21.650 -        </entry>
  21.651 -      </hbox>
  21.652 -      <hbox>
  21.653 -        <text use-markup="true">
  21.654 -          <label>"<b>Route(s)    :</b>"</label>
  21.655 -        </text>
  21.656 -        <entry>
  21.657 -          <variable>DROPBEAR_ROUTE</variable>
  21.658 -	  <default>192.168.10.0/24 192.168.20.0/28</default>
  21.659 -        </entry>
  21.660 -      </hbox>
  21.661 -      <hbox>
  21.662 -$(wikibutton http://doc.slitaz.org/en:guides:vpn)
  21.663 -        <button>
  21.664 -          <input file icon="forward"></input>
  21.665 -	  <label>Connect</label>
  21.666 -	  <action>$0 call vpnssh \$DROPBEAR_PEERVPN \$DROPBEAR_LOCAL \$DROPBEAR_REMOTE "\$DROPBEAR_ROUTE" &</action>
  21.667 -        </button>
  21.668 -        <button>
  21.669 -          <input file icon="stop"></input>
  21.670 -	  <label>Disconnect</label>
  21.671 -	  <action>$0 call killvpnssh</action>
  21.672 -        </button>
  21.673 -        <button>
  21.674 -          <input file icon="go-up"></input>
  21.675 -	  <label>Send key</label>
  21.676 -	  <action>$xterm -geometry 80x10 -title "Send key" -e "$0 call sendsshkey \$DROPBEAR_PEERVPN; echo -e \"----\nENTER to continue...\" && read close"</action>
  21.677 -        </button>
  21.678 -      </hbox>
  21.679 -    </frame>
  21.680 -EOT
  21.681 -}
  21.682 -
  21.683 -#
  21.684 -# PPTP client
  21.685 -#
  21.686 -#FIXME
  21.687 -#cat > /etc/ppp/peers/$TUNNEL <<EOT
  21.688 -#pty "pptp $SERVER --nolaunchpppd"
  21.689 -#lock
  21.690 -#noauth
  21.691 -#nobsdcomp
  21.692 -#nodeflate
  21.693 -#name $DOMAIN\\$USERNAME
  21.694 -#remotename $TUNNEL
  21.695 -#ipparam $TUNNEL
  21.696 -#$(encryption && echo "require-mppe-128")
  21.697 -#EOT
  21.698 -#pppd call $TUNNEL updetach
  21.699 -
  21.700 -tab_pptp()
  21.701 -{
  21.702 -[ -f /etc/ppp/options.pptp ] || cat >> /etc/ppp/options.pptp <<EOT
  21.703 -lock noauth nobsdcomp nodeflate remotename PPTP
  21.704 -EOT
  21.705 -[ -f /etc/ppp/pptp-servers ] || cat >> /etc/ppp/pptp-servers <<EOT
  21.706 -# PPTP servers list
  21.707 -EOT
  21.708 -cat <<EOT
  21.709 -    <frame Virtual Private Network with PPTP>
  21.710 -      <hbox>
  21.711 -        <text use-markup="true">
  21.712 -          <label>"<b>Server:</b>"</label>
  21.713 -        </text>
  21.714 -        <combobox>
  21.715 -          <variable>PPTP_SERVER</variable>
  21.716 -EOT
  21.717 -grep -v ^\# /etc/ppp/pptp-servers | \
  21.718 -awk '{ printf "          <item>%s</item>\n",$1 }'
  21.719 -cat <<EOT
  21.720 -          <item>SERVER</item>
  21.721 -        </combobox>
  21.722 -$(editbutton /etc/ppp/pptp-servers)
  21.723 -      </hbox>
  21.724 -      <hbox>
  21.725 -        <text use-markup="true">
  21.726 -          <label>"<b>   User:</b>"</label>
  21.727 -        </text>
  21.728 -        <combobox>
  21.729 -          <variable>PPTP_USER</variable>
  21.730 -EOT
  21.731 -grep '\\' /etc/ppp/chap-secrets | grep -v ^\# | \
  21.732 -awk '{ printf "          <item>%s</item>\n",$1 }'
  21.733 -cat <<EOT
  21.734 -          <item>DOMAIN\USERNAME</item>
  21.735 -        </combobox>
  21.736 -$(editbutton /etc/ppp/chap-secrets)
  21.737 -      </hbox>
  21.738 -      <hbox>
  21.739 -        <text use-markup="true">
  21.740 -          <label>"<b>Password:</b>"</label>
  21.741 -        </text>
  21.742 -        <entry>
  21.743 -          <variable>PPTP_PASS</variable>
  21.744 -        </entry>
  21.745 -      </hbox>
  21.746 -      <hbox>
  21.747 -      	<checkbox>
  21.748 -	  <label>Encryption</label>
  21.749 -	  <variable>PPTP_ENC</variable>
  21.750 -	  <default>true</default>
  21.751 -      	</checkbox>
  21.752 -$(helpbutton pptp 80x35)
  21.753 -	<button>
  21.754 -	  <input file icon="accessories-text-editor"></input>
  21.755 -	  <label>Options</label>
  21.756 -	  <action type="lauch">leafpad /etc/ppp/options.pptp</action>
  21.757 -	</button>
  21.758 -$(webbutton pptpclient)
  21.759 -        <button>
  21.760 -          <input file icon="forward"></input>
  21.761 -	  <label>Connect</label>
  21.762 -	  <action>grep -qs ^\$PPTP_USER /etc/ppp/chap-secrets || \
  21.763 -echo "\$PPTP_USER PPTP \"$PPTP_PASS\" *" >> /etc/ppp/chap-secrets</action>
  21.764 -	  <action>grep -qs ^\$PPTP_SERVER /etc/ppp/pptp-servers || \
  21.765 -echo "\$PPTP_SERVER" >> /etc/ppp/pptp-servers</action>
  21.766 -	  <action>PASS=""; [ -n "\$PPTP_PASS" ] && PASS="password \$PASS"; \
  21.767 -ENC=""; [ x\$PPTP_ENC == xtrue ] && ENC="require-mppe-128"; \
  21.768 -/usr/sbin/pptp \$PPTP_SERVER file /etc/ppp/options.pptp \$ENC user \$PPTP_USER \$PASS &
  21.769 -	  </action>
  21.770 -        </button>
  21.771 -        <button>
  21.772 -          <input file icon="stop"></input>
  21.773 -	  <label>Disconnect</label>
  21.774 -	  <action>killall pptp</action>
  21.775 -        </button>
  21.776 -      </hbox>
  21.777 -    </frame>
  21.778 -EOT
  21.779 -}
  21.780 -
  21.781 -#
  21.782 -# Cisco EasyVPN
  21.783 -#
  21.784 -tab_easyvpn()
  21.785 -{
  21.786 -cat <<EOT
  21.787 -    <frame Cisco EasyVPN>
  21.788 -<hbox>
  21.789 -	<text use-markup="true">
  21.790 -		<label>"<b>VPNC_OPTIONS</b>"</label>
  21.791 -	</text>
  21.792 -	<entry editable="false">
  21.793 -EOT
  21.794 -[ -n "$VPNC_OPTIONS" ] && cat << EOT
  21.795 -		<default>$tmp</default>
  21.796 -EOT
  21.797 -	cat << EOT
  21.798 -		<variable>VPNC_OPTS</variable>
  21.799 -	</entry>
  21.800 -$(helpbutton vpnc 80x30)
  21.801 -<button>
  21.802 -	<input file icon="help"></input>
  21.803 -	<label>more</label>
  21.804 -	<action>$xterm -geometry 80x40 -title "vpnc help (q to quit)" -e "$(which vpnc) --long-help 2>&1 | less"</action>
  21.805 -</button>
  21.806 -$(editbutton /etc/daemons.conf)
  21.807 -</hbox>
  21.808 -$(configfile /etc/vpnc/default.conf VPNC_CONF)
  21.809 -$(datafile "/etc/vpnc/vpnc-script" VPNC_SCRIPT 'Script:')
  21.810 -      <hbox>
  21.811 -	$(startstopdaemon vpnc)
  21.812 -      </hbox>
  21.813 -     </frame>
  21.814 -EOT
  21.815 -}
  21.816 -
  21.817 -#
  21.818 -# OpenVPN
  21.819 -#
  21.820 -tab_openvpn()
  21.821 -{
  21.822 -local i
  21.823 -local n
  21.824 -cat <<EOT
  21.825 -<frame OpenVPN>
  21.826 -EOT
  21.827 -n=1
  21.828 -for i in /etc/openvpn/*.conf ; do
  21.829 -	[ -f $i ] || continue
  21.830 -	configfile $i OPENVPN_CONF$n
  21.831 -	n=$(($n + 1))
  21.832 -done
  21.833 -cat <<EOT
  21.834 -      <hbox>
  21.835 -	$(helpbutton openvpn 80x40)
  21.836 -	$(startstopdaemon openvpn)
  21.837 -      </hbox>
  21.838 -</frame>
  21.839 -EOT
  21.840 -}
  21.841 -
  21.842 -data_vpn()
  21.843 -{
  21.844 -cat <<EOT
  21.845 -$([ -x /usr/sbin/dropbear -o -x /usr/sbin/sshd ] && echo "pppd" ||
  21.846 -echo "#")   PPP/SSH       tab_sshppp
  21.847 -pptp        PPTP          tab_pptp
  21.848 -vpnc        EasyVPN       tab_easyvpn
  21.849 -openvpn     OpenVPN       tab_openvpn
  21.850 -EOT
  21.851 -}
  21.852 -
  21.853 -#
  21.854 -# VPN
  21.855 -#
  21.856 -tab_vpn()
  21.857 -{
  21.858 -use_tab data_vpn
  21.859 -}
  21.860 -
  21.861 -#
  21.862 -# ether-wake
  21.863 -#
  21.864 -tab_etherwake()
  21.865 -{
  21.866 -cat <<EOT
  21.867 -    <frame Ether-wake (busybox)>
  21.868 -    <hbox>
  21.869 -      <text use-markup="true">
  21.870 -        <label>"<b>Machines :</b>"</label>
  21.871 -      </text>
  21.872 -      <entry editable="false">
  21.873 -        <default>/etc/ethers</default>
  21.874 -        <variable>ETHERS</variable>
  21.875 -      </entry>
  21.876 -      <button>
  21.877 -        <input file icon="accessories-text-editor"></input>
  21.878 -        <action>[ -s \$ETHERS ] || echo "#00:01:02:03:04:05 mystation" >\$ETHERS</action>
  21.879 -        <action type="lauch">leafpad \$ETHERS</action>
  21.880 -      </button>
  21.881 -    </hbox>
  21.882 -    <hbox>
  21.883 -      <text use-markup="true">
  21.884 -        <label>"<b>Options : </b>"</label>
  21.885 -      </text>
  21.886 -      <entry editable="true">
  21.887 -        <variable>ETHERWAKE_OPTS</variable>
  21.888 -      </entry>
  21.889 -$(helpbutton ether-wake 80x15)
  21.890 -	<button>
  21.891 -		<label>Start</label>
  21.892 -		<input file icon="forward"></input>
  21.893 -		<action>ether-wake \$ETHERWAKE_OPTS</action>
  21.894 -	</button>
  21.895 -    </hbox>
  21.896 -    <frame>
  21.897 -    <hbox>
  21.898 -EOT
  21.899 -if which ethtool > /dev/null; then
  21.900 -cat <<EOT
  21.901 -        <text use-markup="true">
  21.902 -          <label>"<b>Interface:</b>"</label>
  21.903 -        </text>
  21.904 -        <combobox>
  21.905 -          <variable>ETHERWAKE_ETH</variable>
  21.906 -EOT
  21.907 -(cd /sys/class/net ; [ -d eth0 ] && ls -d eth* ) | \
  21.908 -awk '{ printf "          <item>%s</item>\n",$1 }'
  21.909 -cat <<EOT
  21.910 -        </combobox>
  21.911 -	<button>
  21.912 -		<label>Enable Wake On LAN</label>
  21.913 -		<input file icon="forward"></input>
  21.914 -		<action>ethtool -s \$ETHERWAKE_ETH wok g</action>
  21.915 -	</button>
  21.916 -EOT
  21.917 -else
  21.918 -cat <<EOT
  21.919 -    <vbox>
  21.920 -	<text wrap="true" width-chars="58">
  21.921 -			<label>
  21.922 -"Ethtool can enable the Wake-on-lan 
  21.923 -feature on many Ethernet cards.
  21.924 -"
  21.925 -			</label>
  21.926 -	</text>
  21.927 -$(installbox ethtool)
  21.928 -    </vbox>
  21.929 -EOT
  21.930 -fi
  21.931 -cat <<EOT
  21.932 -    </hbox>
  21.933 -    </frame>
  21.934 -    </frame>
  21.935 -EOT
  21.936 -}
  21.937 -
  21.938 -data_main()
  21.939 -{
  21.940 -cat <<EOT
  21.941 -#program    tab name      function
  21.942 -ifconfig    Connections   tab_connections
  21.943 -udhcpc      DHCP          tab_udhcpc
  21.944 -ifconfig    Static\ IP    tab_fixed_ip
  21.945 -pppoe       PPPoE         tab_pppoe
  21.946 -pppd        PPP           tab_ppp
  21.947 -true        VPN           tab_vpn
  21.948 -ether-wake  Etherwake     tab_etherwake
  21.949 -true        Configuration tab_system
  21.950 -EOT
  21.951 -}
  21.952 -
  21.953 -tab_main()
  21.954 -{
  21.955 -use_tab data_main
  21.956 -}
  21.957 -
  21.958 -######################################################
  21.959 -#
  21.960 -# Netbox GUI
  21.961 -#
  21.962 -######################################################
  21.963 -
  21.964 -# English/French help dialog.
  21.965 -export HELP='
  21.966 -<window title="Network status" icon-name="network-wire">
  21.967 -<vbox>
  21.968 -	<text use-markup="true">
  21.969 -		<label>
  21.970 -"
  21.971 -<b>SliTaz - Netbox</b>"
  21.972 -		</label>
  21.973 -	</text>
  21.974 -	<frame English>
  21.975 -		<text wrap="true" width-chars="58">
  21.976 -			<label>
  21.977 -"Netbox lets you manage network connections by getting a dynamic IP by 
  21.978 -DHCP or a static IP and setup servers. Netbox can start or stop
  21.979 -networking, configure network interfaces or directly edit files."
  21.980 -			</label>
  21.981 -		</text>
  21.982 -	</frame>
  21.983 -	<frame Francais>
  21.984 -		<text wrap="true" width-chars="58">
  21.985 -			<label>
  21.986 -"Netbox vous permet de gerer les connexions reseau avec une IP
  21.987 -statique ou en obtenant une IP dynamique par DHCP, et de parametrer
  21.988 -les serveurs. Netbox peut demarrer ou arreter le reseau, configurer
  21.989 -les interfaces reseau ou editer directement les fichiers."
  21.990 -			</label>
  21.991 -		</text>
  21.992 -	</frame>
  21.993 -</vbox>
  21.994 -</window>
  21.995 -'
  21.996 -
  21.997 -# Interface status with ifconfig without arguments to show all
  21.998 -# active connections.
  21.999 -#
 21.1000 -export IFCONFIG="
 21.1001 -<window title=\"Network status\" icon-name=\"network-wire\">
 21.1002 -<vbox>
 21.1003 -$(tab_status)
 21.1004 -	<hbox>
 21.1005 -		<button>
 21.1006 -			<input file icon=\"gtk-close\"></input>
 21.1007 -			<action type=\"closewindow\">IFCONFIG</action>
 21.1008 -		</button>
 21.1009 -	</hbox>
 21.1010 -</vbox>
 21.1011 -</window>"
 21.1012 -
 21.1013 -# The main dialog with notebook, start/stop buttons and all options.
 21.1014 -# Note that /etc/network.conf is seded when an interface is activated.
 21.1015 -#
 21.1016 -head='
 21.1017 -<window title="SliTaz Netbox Manager" icon-name="network-wired">
 21.1018 -	<vbox>
 21.1019 -
 21.1020 -		<hbox>
 21.1021 -			<text use-markup="true">
 21.1022 -				<label>"<b>Network Manager</b>"</label>
 21.1023 -			</text>
 21.1024 -			<pixmap>
 21.1025 -				<input file>/usr/share/pixmaps/netbox.png</input>
 21.1026 -			</pixmap>
 21.1027 -		</hbox>
 21.1028 -'
 21.1029 -bottom='
 21.1030 -		<hbox>
 21.1031 -			<button>
 21.1032 -				<label>Wireless manager</label>
 21.1033 -				<input file icon="network-wireless"></input>
 21.1034 -				<action>wifibox &</action>
 21.1035 -			</button>
 21.1036 -			<button>
 21.1037 -				<label>Refresh list</label>
 21.1038 -				<input file icon="reload"></input>
 21.1039 -				<action>refresh:INTERFACE_LIST</action>
 21.1040 -			</button>
 21.1041 -			<button>
 21.1042 -			<label>Full status</label>
 21.1043 -				<input file icon="dialog-information"></input>
 21.1044 -				<action type="launch">IFCONFIG</action>
 21.1045 -			</button>
 21.1046 -			<button help>
 21.1047 -				<label>Help</label>
 21.1048 -				<action type="launch">HELP</action>
 21.1049 -			</button>
 21.1050 -			<button>
 21.1051 -				<label>Quit</label>
 21.1052 -				<input file icon="exit"></input>
 21.1053 -				<action type="exit">Exit</action>
 21.1054 -			</button>
 21.1055 -		</hbox>
 21.1056 -
 21.1057 -	</vbox>
 21.1058 -</window>
 21.1059 -'
 21.1060 -
 21.1061 -NET_BOX="${head}$(tab_main)${bottom}"
 21.1062 -
 21.1063 -export NET_BOX
 21.1064 -
 21.1065 -# TODO:  Modules(Network kernel modules)
 21.1066 -
 21.1067 -# Only root can configure network.
 21.1068 -check_root
 21.1069 -
 21.1070 -# Configure and connect if button Connect was pressed.
 21.1071 -if ! grep -qs ^name /etc/ppp/options ; then
 21.1072 -	# Generate /etc/ppp/options
 21.1073 -	cat > /etc/ppp/options << _EOT_
 21.1074 -plugin rp-pppoe.so
 21.1075 -name provider-ID
 21.1076 -noipdefault
 21.1077 -defaultroute
 21.1078 -mtu 1492
 21.1079 -mru 1492
 21.1080 -lock
 21.1081 -_EOT_
 21.1082 -	# Generate /etc/ppp/pap-secrets
 21.1083 -	cat > /etc/ppp/pap-secrets << _EOT_
 21.1084 -# Secrets for authentication using PAP
 21.1085 -# client	server	secret			IP addresses
 21.1086 -_EOT_
 21.1087 -	# Generate /etc/ppp/chap-secrets
 21.1088 -	cat > /etc/ppp/chap-secrets << _EOT_
 21.1089 -# Secrets for authentication using CHAP
 21.1090 -# client	server	secret			IP addresses
 21.1091 -_EOT_
 21.1092 -fi
 21.1093 -gtkdialog --center --program=NET_BOX | grep -a 'EXIT="restart"' && continue
 21.1094 -exit 0
 21.1095 -done
    22.1 --- a/tinyutils/scpbox	Sat Apr 28 20:16:24 2012 +0200
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,104 +0,0 @@
    22.4 -#!/bin/sh
    22.5 -# 
    22.6 -# Gtkdialog box interface for secure file transfer with scp from Dropbear.
    22.7 -# - SliTaz GNU/Linux 2008-2010.
    22.8 -#
    22.9 -VERSION=20100314
   22.10 -
   22.11 -# Internationalization
   22.12 -. /usr/bin/gettext.sh
   22.13 -TEXTDOMAIN='slitaz-boxes'
   22.14 -export TEXTDOMAIN
   22.15 -
   22.16 -# Box
   22.17 -export SCP_DIALOG='
   22.18 -<window title="Scpbox" icon-name="folder-remote">
   22.19 -<vbox>
   22.20 -
   22.21 -	<text use-markup="true">
   22.22 -		<label>"
   22.23 -<b>SliTaz - Scpbox</b>"
   22.24 -		</label>
   22.25 -	</text>
   22.26 -	<text wrap="true" width-chars="52" use-markup="true">
   22.27 -		<label>"'`gettext "
   22.28 -Copy files securely with scp from Dropbear SSH client/server.
   22.29 -		"`'"</label>
   22.30 -	</text>
   22.31 -	
   22.32 -	<frame '`gettext "Configuration"`'>
   22.33 -		<hbox>
   22.34 -			<text use-markup="true">
   22.35 -				<label>"'`gettext "<b>User        :</b>"`'"</label>
   22.36 -			</text>
   22.37 -			<entry>
   22.38 -				<variable>USER</variable>
   22.39 -			</entry>
   22.40 -		</hbox>
   22.41 -		<hbox>
   22.42 -			<text use-markup="true">
   22.43 -				<label>"'`gettext "<b>Host        :</b>"`'"</label>
   22.44 -			</text>
   22.45 -			<entry>
   22.46 -				<variable>HOST</variable>
   22.47 -			</entry>
   22.48 -		</hbox>
   22.49 -		<hbox>
   22.50 -			<text use-markup="true">
   22.51 -				<label>"'`gettext "<b>Options  :</b>"`'"</label>
   22.52 -			</text>
   22.53 -			<entry>
   22.54 -				<default>-r -P 22</default>
   22.55 -				<variable>SCP_OPTS</variable>
   22.56 -			</entry>
   22.57 -		</hbox>
   22.58 -	</frame>
   22.59 -	
   22.60 -	<frame '`gettext "Paths"`'>
   22.61 -		<hbox>
   22.62 -			<text use-markup="true">
   22.63 -				<label>"'`gettext "<b>Local       :</b>"`'"</label>
   22.64 -			</text>
   22.65 -			<entry>
   22.66 -				<input>echo $HOME</input>
   22.67 -				<variable>LOCAL_PATH</variable>
   22.68 -			</entry>
   22.69 -			<button>
   22.70 -				<input file icon="gtk-open"></input>
   22.71 -				<action type="fileselect">LOCAL_PATH</action>
   22.72 -			</button>
   22.73 -		</hbox>
   22.74 -		<hbox>
   22.75 -			<text use-markup="true">
   22.76 -				<label>"'`gettext "<b>Remote   :</b>"`'"</label>
   22.77 -			</text>
   22.78 -			<entry>
   22.79 -				<variable>REMOTE_PATH</variable>
   22.80 -			</entry>
   22.81 -		</hbox>
   22.82 -	</frame>
   22.83 -	
   22.84 -	<hbox>
   22.85 -		<button>
   22.86 -			<label>'`gettext "Download"`'</label>
   22.87 -			<input file icon="down"></input>
   22.88 -			<action>xterm -geometry 80x16 -e scp $SCP_OPTS $USER@$HOST:$REMOTE_PATH $LOCAL_PATH</action>
   22.89 -		</button>
   22.90 -		<button>
   22.91 -			<label>'`gettext "Upload"`'</label>
   22.92 -			<input file icon="up"></input>
   22.93 -			<action>xterm -geometry 80x16 -e scp $SCP_OPTS $LOCAL_PATH $USER@$HOST:$REMOTE_PATH</action>
   22.94 -		</button>
   22.95 -		<button>
   22.96 -			<label>'`gettext "Exit"`'</label>
   22.97 -			<input file icon="exit"></input>
   22.98 -			<action type="exit">Exit</action>
   22.99 -		</button>
  22.100 -	</hbox>
  22.101 -
  22.102 -</vbox>
  22.103 -</window>'
  22.104 - 
  22.105 -gtkdialog --program=SCP_DIALOG >/dev/null
  22.106 -
  22.107 -exit 0
    23.1 --- a/tinyutils/serverbox	Sat Apr 28 20:16:24 2012 +0200
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,1144 +0,0 @@
    23.4 -#!/bin/sh
    23.5 -#
    23.6 -# Gtkdialog box to manage servers.
    23.7 -# Please use tab to indent.
    23.8 -
    23.9 -VERSION=20100315
   23.10 -
   23.11 -. /usr/lib/slitaz/gui_functions
   23.12 -
   23.13 -# Check if user is root.
   23.14 -check_root()
   23.15 -{
   23.16 -	if test $(id -u) != 0 ; then
   23.17 -		echo -e "
   23.18 -You must be root to run `basename $0`. Please type 'su' and
   23.19 -root password to become super-user.\n"
   23.20 -		exit 0
   23.21 -	fi
   23.22 -}
   23.23 -#
   23.24 -# Status servers
   23.25 -#
   23.26 -tab_status_servers()
   23.27 -{
   23.28 -local servers
   23.29 -servers="dropbear sshd inetd dhcpd dnsd named rsync httpd mbd vnc pppd \
   23.30 -knock postfix fetchmail cyrus perdition slapd sql squid slim cron ntp nfsd \
   23.31 -ftpd cups"
   23.32 -cat <<EOT
   23.33 -<tree>
   23.34 -	<label>Server processes</label>
   23.35 -	<input>for i in $servers; do ps ww | grep \$i | grep -v grep; done</input>
   23.36 -</tree>
   23.37 -EOT
   23.38 -}
   23.39 -
   23.40 -data_status()
   23.41 -{
   23.42 -cat <<EOT
   23.43 -ps          Servers               tab_status_servers
   23.44 -EOT
   23.45 -}
   23.46 -
   23.47 -#
   23.48 -# Status
   23.49 -#
   23.50 -tab_status()
   23.51 -{
   23.52 -use_tab data_status
   23.53 -}
   23.54 -
   23.55 -sshremote()
   23.56 -{
   23.57 -	cat << EOT
   23.58 -      <hbox>
   23.59 -        <text use-markup="true">
   23.60 -          <label>"<b>Remote  :</b>"</label>
   23.61 -        </text>
   23.62 -        <entry>
   23.63 -          <variable>$2</variable>
   23.64 -	  <default>user@elsewhere</default>
   23.65 -        </entry>
   23.66 -        <button>
   23.67 -          <input file icon="utilities-terminal"></input>
   23.68 -	  <label>Connect</label>
   23.69 -	  <action>xterm -fa MiscFixed -fs 11 -bg black -fg white -geometry 80x25 -title "$1" -e "$1 \$$2 ; echo -e \"----\nENTER to continue...\" && read close" &</action>
   23.70 -        </button>
   23.71 -        <button>
   23.72 -          <input file icon="go-up"></input>
   23.73 -	  <label>Send key</label>
   23.74 -	  <action>$xterm -geometry 80x10 -title "send ssh key" -e "$0 call sendsshkey \$$2; echo -e \"----\nENTER to continue...\" && read close"</action>
   23.75 -        </button>
   23.76 -      </hbox>
   23.77 -EOT
   23.78 -}
   23.79 -#
   23.80 -# Dropbear client & server
   23.81 -#
   23.82 -tab_dropbear()
   23.83 -{
   23.84 -. /etc/daemons.conf
   23.85 -set -- $DROPBEAR_OPTIONS
   23.86 -while [ -n "$2" ]; do
   23.87 -  [ "$1" = "-b" ] && DROPBEAR_BANNER="$2" && break
   23.88 -  shift
   23.89 -done
   23.90 -
   23.91 -cat <<EOT
   23.92 -     <frame Dropbear>
   23.93 -$(helpdaemon dropbear 80x35 DROPBEAR_OPTIONS DROPBEAR_OPTS)
   23.94 -$(datafile /etc/dropbear/banner DROPBEAR_BANNER 'Banner   :')
   23.95 -$(sshremote DROPBEAR_PEER 'dbclient -i /etc/dropbear/dropbear_rsa_host_key')
   23.96 -      <hbox>
   23.97 -	$(startstopdaemon dropbear)
   23.98 -      </hbox>
   23.99 -     </frame>
  23.100 -EOT
  23.101 -}
  23.102 -
  23.103 -#
  23.104 -# OpenSSH client & server
  23.105 -#
  23.106 -tab_openssh()
  23.107 -{
  23.108 -cat <<EOT
  23.109 -    <frame OpenSSH>
  23.110 -$(helpdaemon sshd 80x30 OPENSSH_OPTIONS OPENSSH_OPTS 8 nohelp)
  23.111 -$(configfile /etc/ssh/sshd_config OPENSSH_CONF '5 sshd_config')
  23.112 -$(sshremote OPENSSH_PEER 'ssh -i /etc/ssh/ssh_host_rsa_key')
  23.113 -      <hbox>
  23.114 -	$(startstopdaemon openssh)
  23.115 -      </hbox>
  23.116 -     </frame>
  23.117 -EOT
  23.118 -}
  23.119 -
  23.120 -data_sshd()
  23.121 -{
  23.122 -cat <<EOT
  23.123 -dropbear    Dropbear      tab_dropbear
  23.124 -sshd        OpenSSH       tab_openssh
  23.125 -EOT
  23.126 -}
  23.127 -
  23.128 -#
  23.129 -# SSH tab
  23.130 -#
  23.131 -tab_sshd()
  23.132 -{
  23.133 -use_tab data_sshd
  23.134 -}
  23.135 -
  23.136 -#
  23.137 -# Busybox Inetd
  23.138 -#
  23.139 -tab_inetd()
  23.140 -{
  23.141 -cat <<EOT
  23.142 -<frame Inetd (busybox)>
  23.143 -$(helpdaemon inetd 60x20 INETD_OPTIONS INETD_OPTS)
  23.144 -$(configfile /etc/inetd.conf INETD_CONF)
  23.145 -      <hbox>
  23.146 -EOT
  23.147 -for i in $(grep bin /etc/inetd.conf | awk '{ print $6}'); do
  23.148 -  i=$(basename $i)
  23.149 -  helpbutton $i 60x24 $i
  23.150 -done
  23.151 -cat <<EOT
  23.152 -	$(startstopdaemon inetd)
  23.153 -      </hbox>
  23.154 -     </frame>
  23.155 -EOT
  23.156 -}
  23.157 -
  23.158 -#
  23.159 -# ZeroConf
  23.160 -#
  23.161 -tab_zcip()
  23.162 -{
  23.163 -	
  23.164 -	. /etc/daemons.conf
  23.165 -if [ -x /sbin/zcip -a -z "$ZCIP_OPTIONS" ]; then
  23.166 -	ZCIP_OPTIONS="eth0 /etc/zcip.script"
  23.167 -	cat >> /etc/daemons.conf <<EOT
  23.168 -# ZeroConf options
  23.169 -ZCIP_OPTIONS="$ZCIP_OPTIONS"
  23.170 -
  23.171 -EOT
  23.172 -fi
  23.173 -cat <<EOT
  23.174 -     <frame Zcip (busybox)>
  23.175 -$(helpdaemon zcip 60x20 ZCIP_OPTIONS ZCIP_OPTS)
  23.176 -$(datafile /etc/zcip.script CZIP_SCRIPT 'Script :')
  23.177 -      <hbox>
  23.178 -	$(startstopdaemon zcip)
  23.179 -      </hbox>
  23.180 -     </frame>
  23.181 -EOT
  23.182 -}
  23.183 -
  23.184 -#
  23.185 -# Dhcpd ISC
  23.186 -#
  23.187 -tab_isc_dhcpd()
  23.188 -{
  23.189 -cat <<EOT
  23.190 -    <frame Dhcpd (ISC)>
  23.191 -$(helpdaemon dhcpd 60x14 DHCPD_OPTIONS DHCPD_OPTS)
  23.192 -$(configfile /etc/dhcpd.conf DHCPD_CONF)
  23.193 -      <hbox>
  23.194 -	$(startstopdaemon dhcpd dhcp)
  23.195 -      </hbox>
  23.196 -     </frame>
  23.197 -EOT
  23.198 -}
  23.199 -
  23.200 -#
  23.201 -# Dhcpd Busybox
  23.202 -#
  23.203 -tab_udhcpd()
  23.204 -{
  23.205 -cat <<EOT
  23.206 -    <frame Udhcpd (busybox)>
  23.207 -$(helpdaemon udhcpd 60x18 UDHCPD_OPTIONS UDHCPD_OPTS)
  23.208 -$(configfile /etc/udhcpd.conf UDHCPD_CONF)
  23.209 -      <hbox>
  23.210 -	$(startstopdaemon udhcpd busybox)
  23.211 -      </hbox>
  23.212 -     </frame>
  23.213 -EOT
  23.214 -}
  23.215 -
  23.216 -data_dhcpd()
  23.217 -{
  23.218 -cat <<EOT
  23.219 -udhcpd      Udhcpd        tab_udhcpd
  23.220 -dhcpd       Dhcpd         tab_isc_dhcpd
  23.221 -dnsmasq     DNSmasq       tab_dnsmasq
  23.222 -EOT
  23.223 -}
  23.224 -
  23.225 -#
  23.226 -# dhcpd tab
  23.227 -#
  23.228 -tab_dhcpd()
  23.229 -{
  23.230 -use_tab data_dhcpd
  23.231 -}
  23.232 -
  23.233 -#
  23.234 -# PXE forwarder
  23.235 -#
  23.236 -tab_gpxe()
  23.237 -{
  23.238 -cat <<EOT
  23.239 -<frame PXE forwarder>
  23.240 -      <hbox>
  23.241 -        <text use-markup="true">
  23.242 -          <label>"<b>WEB boot URL(s) :</b>"</label>
  23.243 -        </text>
  23.244 -      </hbox>
  23.245 -      <hbox>
  23.246 -        <entry editable="true">
  23.247 -          <default>
  23.248 -"$(dd bs=1 skip=5 count=255 if=/usr/share/boot/gpxe.pxe 2> /dev/null | strings)"
  23.249 -          </default>
  23.250 -          <variable>WEB_PXE</variable>
  23.251 -        </entry>
  23.252 -      </hbox>
  23.253 -      <hbox>
  23.254 -$(wikibutton http://doc.slitaz.org/en:guides:pxe)
  23.255 -        <button>
  23.256 -          <input file icon="go-jump"></input>
  23.257 -	  <label>Install</label>
  23.258 -	  <action>
  23.259 -	echo -n "\$WEB_PXE" | cat - /dev/zero | \
  23.260 -	dd conv=notrunc bs=1 seek=5 count=255 of=/usr/share/boot/gpxe.pxe
  23.261 -	  </action>
  23.262 -	  <action>
  23.263 -	sed -i "s|tftpd -r .*\$|tftpd -r /usr/share/boot|" /etc/inetd.conf
  23.264 -	  </action>
  23.265 -	  <action> sed -i "/^boot_file/d" \$UDHCPD_CONF </action>
  23.266 -	  <action> echo "boot_file gpxe.pxe" >> \$UDHCPD_CONF </action>
  23.267 -	  <action> /etc/init.d/inetd restart </action>
  23.268 -	  <action> /etc/init.d/udhcpd restart </action>
  23.269 -	<action>sed -i "s/RUN_DAEMONS=\\"\\(.*\\)inetd \?\\(.*\\)\\"/RUN_DAEMONS=\\"\1\2\\"/" /etc/rcS.conf</action>
  23.270 -	<action>sed -i "s/RUN_DAEMONS=\\"\\(.*\\)udhcpd \?\\(.*\\)\\"/RUN_DAEMONS=\\"\1\2\\"/" /etc/rcS.conf</action>
  23.271 -	<action>sed -i "s/RUN_DAEMONS=\\"\\(.*\\)\\"/RUN_DAEMONS=\\"udhcpd inetd \1\\"/" /etc/rcS.conf</action>
  23.272 -        </button>
  23.273 -      </hbox>
  23.274 -</frame>
  23.275 -EOT
  23.276 -}
  23.277 -
  23.278 -#
  23.279 -# PXE server
  23.280 -#
  23.281 -tab_pxelinux()
  23.282 -{
  23.283 -cat <<EOT
  23.284 -<frame PXElinux>
  23.285 -      <hbox>
  23.286 -        <text wrap="true">
  23.287 -          <label>
  23.288 -"Launch Dhcpd and Inetd with Tftpd to start the PXE service."
  23.289 -          </label>
  23.290 -        </text>
  23.291 -      </hbox>
  23.292 -      <hbox>
  23.293 -        <text use-markup="true">
  23.294 -          <label>"<b>Configuration :</b>"</label>
  23.295 -        </text>
  23.296 -        <entry editable="false">
  23.297 -          <default>
  23.298 -$(grep bin/tftpd /etc/inetd.conf | awk '{ print $NF }')/pxelinux.cfg/default
  23.299 -          </default>
  23.300 -          <variable>PXE_CONF</variable>
  23.301 -        </entry>
  23.302 -        <button>
  23.303 -          <input file icon="accessories-text-editor"></input>
  23.304 -	  <action>dir=\$(dirname \$PXE_CONF); [ -d \$dir ] || mkdir -p \$dir</action>
  23.305 -	  <action>lzma d /usr/share/boot/pxelinux.0.lzma \$(dirname \$PXE_CONF)/../pxelinux.0</action>
  23.306 -	  <action>sed -i "/^boot_file/d" \$UDHCPD_CONF</action>
  23.307 -	  <action>echo "boot_file pxelinux.0" >> \$UDHCPD_CONF</action>
  23.308 -	  <action>grep -q "^siaddr" \$UDHCPD_CONF || echo "siaddr \$(ifconfig \$INTERFACE | grep inet.ad | cut -d: -f2 | cut -d\  -f1)" >> \$UDHCPD_CONF</action>
  23.309 -	  <action>[ -f \$PXE_CONF ] || echo -e "label linux\n\tkernel bzImage\n\tappend initrd=rootfs.gz rw root=/dev/null vga=normal" > \$PXE_CONF</action>
  23.310 -          <action type="lauch">leafpad \$PXE_CONF</action>
  23.311 -        </button>
  23.312 -      </hbox>
  23.313 -      <hbox>
  23.314 -$(wikibutton http://doc.slitaz.org/en:guides:pxe)
  23.315 -        <button>
  23.316 -          <input file icon="system-file-manager"></input>
  23.317 -	  <label>Network boot files</label>
  23.318 -	  <action>$xterm -geometry 100x25 -title "Network boot files (q to quit)" -e "find \$(dirname \$(dirname \$PXE_CONF)) -exec ls -ld {} \; | less"</action>
  23.319 -        </button>
  23.320 -      </hbox>
  23.321 -     </frame>
  23.322 -EOT
  23.323 -}
  23.324 -
  23.325 -data_pxe()
  23.326 -{
  23.327 -[ -f /usr/share/boot/pxelinux.0.lzma ] && cat <<EOT
  23.328 -true        PXElinux          tab_pxelinux
  23.329 -EOT
  23.330 -[ -f /usr/share/boot/gpxe.pxe ] && cat <<EOT
  23.331 -true        PXE\ forwarder    tab_gpxe
  23.332 -EOT
  23.333 -}
  23.334 -
  23.335 -#
  23.336 -# PXE
  23.337 -#
  23.338 -tab_pxe()
  23.339 -{
  23.340 -use_tab data_pxe
  23.341 -}
  23.342 -
  23.343 -#
  23.344 -# Busybox dnsd
  23.345 -#
  23.346 -tab_dnsd()
  23.347 -{
  23.348 -cat <<EOT
  23.349 -    <frame Dnsd (busybox master dns)>
  23.350 -$(helpdaemon dnsd 80x24 DNSD_OPTIONS DNSD_OPTS)
  23.351 -$(configfile /etc/dnsd.conf DNSD_CONF)
  23.352 -      <hbox>
  23.353 -	$(startstopdaemon dnsd busybox)
  23.354 -      </hbox>
  23.355 -     </frame>
  23.356 -EOT
  23.357 -}
  23.358 -
  23.359 -#
  23.360 -# ISC Bind
  23.361 -#
  23.362 -tab_named()
  23.363 -{
  23.364 -cat <<EOT
  23.365 -    <frame Named (ISC bind)>
  23.366 -$(helpdaemon named 80x10 NAMED_OPTIONS NAMED_OPTS)
  23.367 -$(configfile /etc/bind/named.conf.local NAMED_CONF)
  23.368 -      <hbox>
  23.369 -	$(startstopdaemon named bind)
  23.370 -      </hbox>
  23.371 -     </frame>
  23.372 -EOT
  23.373 -}
  23.374 -
  23.375 -#
  23.376 -# DNSmasq 
  23.377 -#
  23.378 -tab_dnsmasq()
  23.379 -{
  23.380 -cat <<EOT
  23.381 -    <frame DNSmasq (DNS/DHCP/TFTP)>
  23.382 -$(helpdaemon dnsmasq 100x34 DNSMASQ_OPTIONS DNSMASQ_OPTS)
  23.383 -$(configfile /etc/dnsmasq.conf DNSMASQ_CONF)
  23.384 -      <hbox>
  23.385 -	$(startstopdaemon dnsmasq)
  23.386 -      </hbox>
  23.387 -     </frame>
  23.388 -EOT
  23.389 -}
  23.390 -
  23.391 -data_dns()
  23.392 -{
  23.393 -cat <<EOT
  23.394 -dnsd        Dnsd          tab_dnsd
  23.395 -named       Named         tab_named
  23.396 -dnsmasq     DNSmasq       tab_dnsmasq
  23.397 -#TODO sheerdns    Sheerdns      tab_sheerdns
  23.398 -EOT
  23.399 -}
  23.400 -
  23.401 -#
  23.402 -# dns tab
  23.403 -#
  23.404 -tab_dns()
  23.405 -{
  23.406 -use_tab data_dns
  23.407 -}
  23.408 -
  23.409 -#
  23.410 -# Postfix 
  23.411 -#
  23.412 -tab_postfix()
  23.413 -{
  23.414 -cat <<EOT
  23.415 -    <frame Postfix>
  23.416 -$(configfile /etc/postfix/main.cf POSTFIX_CONF)
  23.417 -      <hbox>
  23.418 -	$(startstopdaemon postfix)
  23.419 -      </hbox>
  23.420 -     </frame>
  23.421 -EOT
  23.422 -}
  23.423 -
  23.424 -#
  23.425 -# Fetchmail 
  23.426 -#
  23.427 -tab_fetchmail()
  23.428 -{
  23.429 -cat <<EOT
  23.430 -    <frame Fetchmail>
  23.431 -$(helpdaemon fetchmail 100x34 FETCHMAIL_OPTIONS FETCHMAIL_OPTS)
  23.432 -$(configfile /etc/fetchmail.conf FETCHMAIL_CONF)
  23.433 -      <hbox>
  23.434 -	$(startstopdaemon fetchmail)
  23.435 -      </hbox>
  23.436 -     </frame>
  23.437 -EOT
  23.438 -}
  23.439 -
  23.440 -#
  23.441 -# Postgrey 
  23.442 -#
  23.443 -tab_postgrey()
  23.444 -{
  23.445 -cat <<EOT
  23.446 -    <frame Postgrey (SMTP grey list)>
  23.447 -$(helpdaemon postgrey 100x34 POSTGREY_OPTIONS POSTGREY_OPTS)
  23.448 -      <hbox>
  23.449 -	$(startstopdaemon postgrey)
  23.450 -      </hbox>
  23.451 -     </frame>
  23.452 -EOT
  23.453 -}
  23.454 -
  23.455 -data_smtp()
  23.456 -{
  23.457 -cat <<EOT
  23.458 -postfix     Postfix       tab_postfix
  23.459 -fetchmail   Fetchmail     tab_fetchmail
  23.460 -postgrey    Grey\ list    tab_postgrey
  23.461 -EOT
  23.462 -}
  23.463 -
  23.464 -#
  23.465 -# smtp tab
  23.466 -#
  23.467 -tab_smtp()
  23.468 -{
  23.469 -use_tab data_smtp
  23.470 -}
  23.471 -
  23.472 -#
  23.473 -# Cyrus IMAP 
  23.474 -#
  23.475 -tab_cyrus()
  23.476 -{
  23.477 -cat <<EOT
  23.478 -    <frame Cyrus IMAP/POP3>
  23.479 -$(configfile /etc/imapd.conf IMAPD_CONF)
  23.480 -$(configfile /etc/cyrus.conf CYRUS_CONF)
  23.481 -      <hbox>
  23.482 -	$(startstopdaemon cyrus-imapd)
  23.483 -      </hbox>
  23.484 -     </frame>
  23.485 -EOT
  23.486 -}
  23.487 -
  23.488 -#
  23.489 -# Perdition IMAP/POP3 proxy
  23.490 -#
  23.491 -tab_perdition()
  23.492 -{
  23.493 -cat <<EOT
  23.494 -    <frame Perdition IMAP/POP3 proxy>
  23.495 -$(helpdaemon perdition 100x34 PERDITION_OPTIONS PERDITION_OPTS)
  23.496 -$(configfile /etc/perdition/perdition.imap4.conf PROXY_IMAP_CONF)
  23.497 -$(configfile /etc/perdition/perdition.pop3.conf PROXY_POP3_CONF)
  23.498 -      <hbox>
  23.499 -	$(startstopdaemon perdition)
  23.500 -      </hbox>
  23.501 -     </frame>
  23.502 -EOT
  23.503 -}
  23.504 -
  23.505 -data_imap()
  23.506 -{
  23.507 -cat <<EOT
  23.508 -cyradm      Cyrus         tab_cyrus
  23.509 -perdition   Proxy         tab_perdition
  23.510 -EOT
  23.511 -}
  23.512 -
  23.513 -#
  23.514 -# imap tab
  23.515 -#
  23.516 -tab_imap()
  23.517 -{
  23.518 -use_tab data_imap
  23.519 -}
  23.520 -
  23.521 -#
  23.522 -# Squid 
  23.523 -#
  23.524 -tab_squid()
  23.525 -{
  23.526 -cat <<EOT
  23.527 -    <frame Squid>
  23.528 -$(helpdaemon squid 100x26 SQUID_OPTIONS SQUID_OPTS)
  23.529 -$(configfile /etc/squid.conf SQUID_CONF)
  23.530 -$([ -s /etc/squidGuard/squidGuard.conf ] && configfile /etc/squidGuard/squidGuard.conf SQUIDGUARD_CONF)
  23.531 -      <hbox>
  23.532 -	$(startstopdaemon squid)
  23.533 -      </hbox>
  23.534 -     </frame>
  23.535 -EOT
  23.536 -}
  23.537 -
  23.538 -#
  23.539 -# Asterisk 
  23.540 -#
  23.541 -tab_asterisk()
  23.542 -{
  23.543 -cat <<EOT
  23.544 -    <frame Asterisk telephony>
  23.545 -$(configfile /etc/asterisk/extensions.conf ASTERISK_CONF)
  23.546 -      <hbox>
  23.547 -	$(startstopdaemon asterisk)
  23.548 -      </hbox>
  23.549 -     </frame>
  23.550 -EOT
  23.551 -}
  23.552 -
  23.553 -#
  23.554 -# OpenLDAP 
  23.555 -#
  23.556 -tab_openldap()
  23.557 -{
  23.558 -cat <<EOT
  23.559 -    <frame OpenLDAP>
  23.560 -$(configfile /etc/openldap/slapd.conf LDAP_CONF)
  23.561 -      <hbox>
  23.562 -	$(startstopdaemon openldap)
  23.563 -      </hbox>
  23.564 -     </frame>
  23.565 -EOT
  23.566 -}
  23.567 -
  23.568 -#
  23.569 -# MySQL 
  23.570 -#
  23.571 -tab_mysql()
  23.572 -{
  23.573 -cat <<EOT
  23.574 -    <frame MySQL>
  23.575 -$(helpdaemon mysqld_safe 100x24 MYSQL_OPTIONS MYSQL_OPTS)
  23.576 -$(configfile /etc/my.conf MYSQL_CONF)
  23.577 -      <hbox>
  23.578 -	$(startstopdaemon mysql)
  23.579 -      </hbox>
  23.580 -     </frame>
  23.581 -EOT
  23.582 -}
  23.583 -
  23.584 -#
  23.585 -# PostgreSQL 
  23.586 -#
  23.587 -tab_postgresql()
  23.588 -{
  23.589 -cat <<EOT
  23.590 -    <frame PostgreSQL>
  23.591 -$(helpdaemon postgres 100x34 PGSQL_OPTIONS PGSQL_OPTS)
  23.592 -$(configfile /etc/postgresql.conf POSTGRESQL_CONF)
  23.593 -      <hbox>
  23.594 -	$(startstopdaemon postgresql)
  23.595 -      </hbox>
  23.596 -     </frame>
  23.597 -EOT
  23.598 -}
  23.599 -
  23.600 -data_sql()
  23.601 -{
  23.602 -cat <<EOT
  23.603 -mysqld_safe MySQL         tab_mysql
  23.604 -postgres    PostgreSQL    tab_postgresql
  23.605 -EOT
  23.606 -}
  23.607 -
  23.608 -#
  23.609 -# sql tab
  23.610 -#
  23.611 -tab_sql()
  23.612 -{
  23.613 -use_tab data_sql
  23.614 -}
  23.615 -
  23.616 -#
  23.617 -# Slim display manager 
  23.618 -#
  23.619 -tab_slim()
  23.620 -{
  23.621 -cat <<EOT
  23.622 -    <frame Slim display manager>
  23.623 -$(helpdaemon slim 80x10 SLIM_OPTIONS SLIM_OPTS)
  23.624 -$(configfile /etc/slim.conf SLIM_CONF)
  23.625 -      <hbox>
  23.626 -	$(startstopdaemon slim)
  23.627 -      </hbox>
  23.628 -     </frame>
  23.629 -EOT
  23.630 -}
  23.631 -
  23.632 -#
  23.633 -# Cron 
  23.634 -#
  23.635 -tab_cron()
  23.636 -{
  23.637 -cat <<EOT
  23.638 -    <frame Crond (busybox)>
  23.639 -$(helpdaemon crond 80x15 CROND_OPTIONS CROND_OPTS)
  23.640 -      <hbox>
  23.641 -	$(startstopdaemon crond)
  23.642 -      </hbox>
  23.643 -     </frame>
  23.644 -EOT
  23.645 -}
  23.646 -
  23.647 -#
  23.648 -# NTP
  23.649 -#
  23.650 -tab_ntp()
  23.651 -{
  23.652 -cat <<EOT
  23.653 -    <frame Ntpd>
  23.654 -$(helpdaemon ntpd 100x34 NTP_OPTIONS NTP_OPTS)
  23.655 -$(configfile /etc/ntp.conf NTP_CONF)
  23.656 -      <hbox>
  23.657 -	$(startstopdaemon ntp)
  23.658 -      </hbox>
  23.659 -     </frame>
  23.660 -EOT
  23.661 -}
  23.662 -
  23.663 -#
  23.664 -# nfsd
  23.665 -#
  23.666 -tab_nfsd()
  23.667 -{
  23.668 -cat <<EOT
  23.669 -    <frame Nfsd>
  23.670 -$(configfile /etc/exports EXPORTS)
  23.671 -      <hbox>
  23.672 -	$(startstopdaemon nfsd nfs-utils)
  23.673 -      </hbox>
  23.674 -     </frame>
  23.675 -EOT
  23.676 -}
  23.677 -
  23.678 -#
  23.679 -# unfsd
  23.680 -#
  23.681 -tab_unfsd()
  23.682 -{
  23.683 -cat <<EOT
  23.684 -    <frame Unfsd>
  23.685 -$(helpdaemon ntpd 80x20 UNFSD_OPTIONS UNFSD_OPTS)
  23.686 -$(configfile /etc/exports EXPORTS)
  23.687 -      <hbox>
  23.688 -	$(startstopdaemon unfsd unfs3)
  23.689 -      </hbox>
  23.690 -     </frame>
  23.691 -EOT
  23.692 -}
  23.693 -
  23.694 -data_nfs()
  23.695 -{
  23.696 -cat <<EOT
  23.697 -rpc.nfsd    Nfsd          tab_nfsd
  23.698 -unfsd       Unfsd         tab_unfsd 
  23.699 -EOT
  23.700 -}
  23.701 -
  23.702 -#
  23.703 -# nfs tab
  23.704 -#
  23.705 -tab_nfs()
  23.706 -{
  23.707 -use_tab data_nfs
  23.708 -}
  23.709 -
  23.710 -#
  23.711 -# ftpd
  23.712 -#
  23.713 -tab_ftpd()
  23.714 -{
  23.715 -cat <<EOT
  23.716 -    <frame ftpd>
  23.717 -$(helpdaemon ftpd 100x34 FTPD_OPTIONS FTPD_OPTS)
  23.718 -      <hbox>
  23.719 -	$(startstopdaemon ftpd)
  23.720 -      </hbox>
  23.721 -     </frame>
  23.722 -EOT
  23.723 -}
  23.724 -
  23.725 -#
  23.726 -# pure-ftpd
  23.727 -#
  23.728 -tab_pureftpd()
  23.729 -{
  23.730 -cat <<EOT
  23.731 -    <frame pure-ftpd>
  23.732 -$(helpdaemon pure-ftpd 80x34 PUREFTPD_OPTIONS PUREFTPD_OPTS)
  23.733 -      <hbox>
  23.734 -	$(startstopdaemon pure-ftpd)
  23.735 -      </hbox>
  23.736 -     </frame>
  23.737 -EOT
  23.738 -}
  23.739 -
  23.740 -data_ftp()
  23.741 -{
  23.742 -cat <<EOT
  23.743 -$(readlink /usr/bin/ftpd | grep -q busybox && echo "true" ||
  23.744 -echo "#")   Busybox\ ftpd tab_ftpd
  23.745 -pure-ftpd   pure-ftpd     tab_pureftpd
  23.746 -EOT
  23.747 -}
  23.748 -
  23.749 -#
  23.750 -# ftp tab
  23.751 -#
  23.752 -tab_ftp()
  23.753 -{
  23.754 -use_tab data_ftp
  23.755 -}
  23.756 -
  23.757 -#
  23.758 -# NTP
  23.759 -#
  23.760 -tab_ntp()
  23.761 -{
  23.762 -cat <<EOT
  23.763 -    <frame Ntpd>
  23.764 -$(helpdaemon ntpd 80x20 NTP_OPTIONS NTP_OPTS)
  23.765 -$(configfile /etc/ntp.conf NTP_CONF)
  23.766 -      <hbox>
  23.767 -	$(startstopdaemon ntp)
  23.768 -      </hbox>
  23.769 -     </frame>
  23.770 -EOT
  23.771 -}
  23.772 -
  23.773 -#
  23.774 -# cups
  23.775 -#
  23.776 -tab_cups()
  23.777 -{
  23.778 -cat <<EOT
  23.779 -    <frame Cupsd>
  23.780 -$(helpdaemon cupsd 80x12 CUPSD_OPTIONS CUPSD_OPTS)
  23.781 -$(configfile /etc/cups/cupsd.conf CUPSD_CONF)
  23.782 -      <hbox>
  23.783 -	$(startstopdaemon cupsd)
  23.784 -      </hbox>
  23.785 -     </frame>
  23.786 -EOT
  23.787 -}
  23.788 -
  23.789 -#
  23.790 -# rsync server
  23.791 -#
  23.792 -tab_rsync()
  23.793 -{
  23.794 -cat <<EOT
  23.795 -     <frame Rsync>
  23.796 -$(helpdaemon rsync 80x30 RSYNCD_OPTIONS RSYNCD_OPTS 1)
  23.797 -$(configfile /etc/rsyncd.conf RSYNCD_CONF)
  23.798 -$(datafile /etc/rsyncd.secrets RSYNCD_SECRETS 'Secrets file     :')
  23.799 -      <hbox>
  23.800 -	$(startstopdaemon rsyncd rsync)
  23.801 -      </hbox>
  23.802 -     </frame>
  23.803 -EOT
  23.804 -}
  23.805 -
  23.806 -php_ini()
  23.807 -{
  23.808 -[ -f /etc/php.ini ] && cat <<EOT
  23.809 -      <frame PHP>
  23.810 -$(configfile /etc/php.ini PHP_CONF)
  23.811 -      </frame>
  23.812 -EOT
  23.813 -}
  23.814 -
  23.815 -#
  23.816 -# Apache server
  23.817 -#
  23.818 -tab_apache()
  23.819 -{
  23.820 -cat <<EOT
  23.821 -     <frame Apache>
  23.822 -$(configfile /etc/apache/httpd.conf HTTPD_CONF)
  23.823 -$(php_ini)
  23.824 -      <hbox>
  23.825 -	$(startstopdaemon apache)
  23.826 -      </hbox>
  23.827 -     </frame>
  23.828 -EOT
  23.829 -}
  23.830 -
  23.831 -#
  23.832 -# Lighttpd server
  23.833 -#
  23.834 -tab_lighttpd()
  23.835 -{
  23.836 -cat <<EOT
  23.837 -     <frame Lighttpd>
  23.838 -$(helpdaemon lighttpd 80x15 LIGHTTPD_OPTIONS LIGHTTPD_OPTS)
  23.839 -$(configfile /etc/lighttpd/lighttpd.conf LIGHTTPD_CONF)
  23.840 -$(php_ini)
  23.841 -      <hbox>
  23.842 -	$(startstopdaemon lighttpd)
  23.843 -      </hbox>
  23.844 -     </frame>
  23.845 -EOT
  23.846 -}
  23.847 -
  23.848 -#
  23.849 -# Busybox httpd server
  23.850 -#
  23.851 -tab_httpd()
  23.852 -{
  23.853 -cat <<EOT
  23.854 -     <frame httpd (busybox)>
  23.855 -$(helpdaemon httpd 80x30 HTTPD_OPTIONS HTTPD_OPTS)
  23.856 -$(configfile /etc/httpd.conf HTTPD_CONF)
  23.857 -$(php_ini)
  23.858 -      <hbox>
  23.859 -	$(startstopdaemon httpd busybox)
  23.860 -      </hbox>
  23.861 -     </frame>
  23.862 -EOT
  23.863 -}
  23.864 -
  23.865 -data_http()
  23.866 -{
  23.867 -cat <<EOT
  23.868 -/etc/apache/httpd.conf  Apache          tab_apache
  23.869 -lighttpd                Lighttpd        tab_lighttpd
  23.870 -/etc/httpd.conf         Busybox\ httpd  tab_httpd
  23.871 -squid                   Web\ cache      tab_squid
  23.872 -EOT
  23.873 -}
  23.874 -
  23.875 -#
  23.876 -# http tab
  23.877 -#
  23.878 -tab_http()
  23.879 -{
  23.880 -use_tab data_http
  23.881 -}
  23.882 -
  23.883 -#
  23.884 -# Samba servers
  23.885 -#
  23.886 -tab_wins()
  23.887 -{
  23.888 -cat <<EOT
  23.889 -     <frame Samba: smbd & nmbd>
  23.890 -$(configfile /etc/samba/smb.conf SMBD_CONF)
  23.891 -      <hbox>
  23.892 -        <button>
  23.893 -          <label>Reload</label>
  23.894 -          <input file icon="reload"></input>
  23.895 -          <action>/etc/init.d/samba reload</action>
  23.896 -        </button>
  23.897 -	$(startstopdaemon samba)
  23.898 -      </hbox>
  23.899 -     </frame>
  23.900 -EOT
  23.901 -}
  23.902 -
  23.903 -#
  23.904 -# x11vnc
  23.905 -#
  23.906 -tab_vnc()
  23.907 -{
  23.908 -cat <<EOT
  23.909 -     <frame x11vnc>
  23.910 -$(helpdaemon x11vnc 80x30 X11VNC_OPTIONS X11VNC_OPTS)
  23.911 -      <hbox>
  23.912 -        <text use-markup="true">
  23.913 -          <label>"<b>New password</b>"</label>
  23.914 -        </text>
  23.915 -        <entry>
  23.916 -          <variable>X11VNC_PASSWD</variable>
  23.917 -        </entry>
  23.918 -        <button>
  23.919 -          <input file icon="reload"></input>
  23.920 -          <label>Update</label>
  23.921 -          <action>x11vnc -storepasswd \$X11VNC_PASSWD /etc/vnc.secret</action>
  23.922 -        </button>
  23.923 -      </hbox>
  23.924 -      <hbox>
  23.925 -	$(startstopdaemon x11vnc)
  23.926 -      </hbox>
  23.927 -     </frame>
  23.928 -EOT
  23.929 -}
  23.930 -
  23.931 -#
  23.932 -# knock server
  23.933 -#
  23.934 -tab_knockd()
  23.935 -{
  23.936 -cat <<EOT
  23.937 -    <frame Knockd: trigger backdoors>
  23.938 -$(helpdaemon knockd 80x15 KNOCK_OPTIONS KNOCK_OPTS)
  23.939 -$(configfile /etc/knockd.conf KNOCKD_CONF)
  23.940 -      <hbox>
  23.941 -	$(startstopdaemon knockd knock)
  23.942 -      </hbox>
  23.943 -     </frame>
  23.944 -EOT
  23.945 -}
  23.946 -
  23.947 -data_servers()
  23.948 -{
  23.949 -local $pxe
  23.950 -pxe="#"
  23.951 -[ -x /usr/bin/tftpd -a -x /usr/sbin/udhcpd ] && pxe="inetd"
  23.952 -[ -x /usr/sbin/dnsmasq ] && pxe="true"
  23.953 -[ -f /usr/share/boot/pxelinux.0.lzma -o /usr/share/boot/gpxe.pxe ] || pxe="#"
  23.954 -cat <<EOT
  23.955 -slim        Slim          tab_slim
  23.956 -crond       Crond         tab_cron
  23.957 -inetd       Inetd         tab_inetd
  23.958 -zcip        ZeroConf      tab_zcip
  23.959 -$([ -x /usr/sbin/udhcpd -o -x /usr/sbin/dhcpd -o -x /usr/sbin/dnsmasq ] && 
  23.960 -echo "true" ||
  23.961 -echo "#")   DHCP          tab_dhcpd
  23.962 -$pxe        PXE           tab_pxe
  23.963 -$([ -x /usr/sbin/dnsd -o -x /usr/sbin/named -o -x /usr/sbin/dnsmasq ] && 
  23.964 -echo "true" ||
  23.965 -echo "#")   DNS           tab_dns
  23.966 -ntpd        NTP           tab_ntp
  23.967 -cupsd       CUPS          tab_cups
  23.968 -$([ -x /usr/bin/mysqld_safe -o -x /usr/bin/postgres ] && echo "true" ||
  23.969 -echo "#")   SQL           tab_sql
  23.970 -knockd      Knock         tab_knockd
  23.971 -$([ -x /usr/sbin/dropbear -o -x /usr/sbin/sshd ] && echo "true" ||
  23.972 -echo "#")   SSH           tab_sshd
  23.973 -x11vnc      VNC           tab_vnc 
  23.974 -dnsmasq     TFTP          tab_dnsmasq
  23.975 -$([ -x /usr/bin/ftpd -o -x /usr/sbin/pure-ftpd ] && echo "true" ||
  23.976 -echo "#")   FTP           tab_ftp
  23.977 -$([ -x /usr/sbin/lighttpd -o -x /usr/bin/httpd -o -x /usr/sbin/squid ] && echo "true" || 
  23.978 -echo "#")   HTTP          tab_http
  23.979 -rsync       Rsync         tab_rsync
  23.980 -$([ -x /usr/sbin/rpc.nfsd -o -x /usr/bin/unfsd ] && echo "true" ||
  23.981 -echo "#")   NFS           tab_nfs
  23.982 -smbd        SAMBA         tab_wins
  23.983 -slapcat     LDAP          tab_openldap
  23.984 -postfix     SMTP          tab_smtp
  23.985 -cyradm      IMAP          tab_imap
  23.986 -asterisk    Telephony     tab_asterisk
  23.987 -#TODO+callback pppd        Pppd          tab_pppd
  23.988 -#TODO pptpd       PoPToP        tab_poptop
  23.989 -EOT
  23.990 -}
  23.991 -
  23.992 -#
  23.993 -# Servers tab
  23.994 -#
  23.995 -tab_servers()
  23.996 -{
  23.997 -use_tab data_servers
  23.998 -}
  23.999 -
 23.1000 -#
 23.1001 -# Firewall tab
 23.1002 -#
 23.1003 -tab_firewall()
 23.1004 -{
 23.1005 -cat <<EOT
 23.1006 -    <frame Iptables>
 23.1007 -$(configfile /etc/firewall.conf IPTABLES_CONF)
 23.1008 -      <hbox>
 23.1009 -$(helpbutton iptables 80x30)
 23.1010 -$(manbutton 8 iptables)
 23.1011 -$(webbutton iptables)
 23.1012 -        <button>
 23.1013 -          <label>Load</label>
 23.1014 -          <input file icon="reload"></input>
 23.1015 -          <action>cat \$IPTABLES_CONF | /sbin/iptables-restore</action>
 23.1016 -        </button>
 23.1017 -        <button>
 23.1018 -          <label>Save</label>
 23.1019 -          <input file icon="go-jump"></input>
 23.1020 -          <action>/sbin/iptables-save > \$IPTABLES_CONF</action>
 23.1021 -        </button>
 23.1022 -      </hbox>
 23.1023 -     </frame>
 23.1024 -EOT
 23.1025 -}
 23.1026 -
 23.1027 -#
 23.1028 -# knock client
 23.1029 -#
 23.1030 -tab_knock()
 23.1031 -{
 23.1032 -cat <<EOT
 23.1033 -    <frame Knock>
 23.1034 -    <hbox>
 23.1035 -      <text use-markup="true">
 23.1036 -        <label>"<b>Options : </b>"</label>
 23.1037 -      </text>
 23.1038 -      <entry editable="true">
 23.1039 -        <variable>KNOCK_OPTS</variable>
 23.1040 -	<default>myserver.example.com 123:tcp 456:udp 789:tcp</default>
 23.1041 -      </entry>
 23.1042 -    </hbox>
 23.1043 -    <hbox>
 23.1044 -$(helpbutton knock 80x12)
 23.1045 -      <button>
 23.1046 -        <label>Start</label>
 23.1047 -        <input file icon="forward"></input>
 23.1048 -        <action>knock \$KNOCK_OPTS</action>
 23.1049 -      </button>
 23.1050 -    </hbox>
 23.1051 -    </frame>
 23.1052 -EOT
 23.1053 -}
 23.1054 -
 23.1055 -data_main()
 23.1056 -{
 23.1057 -cat <<EOT
 23.1058 -#program    tab name      function
 23.1059 -true        Servers       tab_servers
 23.1060 -iptables    Firewall      tab_firewall
 23.1061 -knock       Knock         tab_knock
 23.1062 -true        Status        tab_status
 23.1063 -EOT
 23.1064 -}
 23.1065 -
 23.1066 -tab_main()
 23.1067 -{
 23.1068 -use_tab data_main
 23.1069 -}
 23.1070 -
 23.1071 -######################################################
 23.1072 -#
 23.1073 -# Serverbox GUI
 23.1074 -#
 23.1075 -######################################################
 23.1076 -
 23.1077 -# Only root can configure server.
 23.1078 -check_root
 23.1079 -
 23.1080 -# English/French help dialog.
 23.1081 -export HELP='
 23.1082 -<window title="Network status" icon-name="network-wire">
 23.1083 -<vbox>
 23.1084 -	<text use-markup="true">
 23.1085 -		<label>
 23.1086 -"
 23.1087 -<b>SliTaz - Serverbox</b>"
 23.1088 -		</label>
 23.1089 -	</text>
 23.1090 -	<frame English>
 23.1091 -		<text wrap="true" width-chars="58">
 23.1092 -			<label>
 23.1093 -"Serverbox lets you manage and setup servers. First, install and 
 23.1094 -edit any configuration files. Then, start or stop the servers."
 23.1095 -			</label>
 23.1096 -		</text>
 23.1097 -	</frame>
 23.1098 -	<frame Francais>
 23.1099 -		<text wrap="true" width-chars="58">
 23.1100 -			<label>
 23.1101 -"Serverbox peut demarrer ou arreter le reseau, configurer
 23.1102 -les interfaces reseau ou editer directement les fichiers."
 23.1103 -			</label>
 23.1104 -		</text>
 23.1105 -	</frame>
 23.1106 -</vbox>
 23.1107 -</window>
 23.1108 -'
 23.1109 -
 23.1110 -# The main dialog with notebook, start/stop buttons and all options.
 23.1111 -# Note that /etc/network.conf is seded when an interface is activated.
 23.1112 -#
 23.1113 -head='
 23.1114 -<window title="SliTaz Server Manager" icon-name="network-wired">
 23.1115 -	<vbox>
 23.1116 -
 23.1117 -		<hbox>
 23.1118 -			<text use-markup="true">
 23.1119 -				<label>"<b>Server Manager</b>"</label>
 23.1120 -			</text>
 23.1121 -			<pixmap>
 23.1122 -				<input file>/usr/share/pixmaps/netbox.png</input>
 23.1123 -			</pixmap>
 23.1124 -		</hbox>
 23.1125 -'
 23.1126 -bottom='
 23.1127 -		<hbox>
 23.1128 -			<button help>
 23.1129 -				<label>Help</label>
 23.1130 -				<action type="launch">HELP</action>
 23.1131 -			</button>
 23.1132 -			<button>
 23.1133 -				<label>Quit</label>
 23.1134 -				<input file icon="exit"></input>
 23.1135 -				<action type="exit">Exit</action>
 23.1136 -			</button>
 23.1137 -		</hbox>
 23.1138 -
 23.1139 -	</vbox>
 23.1140 -</window>
 23.1141 -'
 23.1142 -
 23.1143 -SERVER_BOX="${head}$(tab_main)${bottom}"
 23.1144 -
 23.1145 -export SERVER_BOX
 23.1146 -
 23.1147 -gtkdialog --center --program=SERVER_BOX >/dev/null
    24.1 --- a/tinyutils/sshbox	Sat Apr 28 20:16:24 2012 +0200
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,498 +0,0 @@
    24.4 -#! /bin/sh
    24.5 -# 
    24.6 -# Gtkdialog box interface for SSH connections.
    24.7 -#
    24.8 -# Manage profile in .prf files store in $HOME/.sshbox 
    24.9 -# (c) 2009 SliTaz GNU/Linux - GNU gpl v3
   24.10 -#
   24.11 -
   24.12 -
   24.13 -# Create config directory and init default var
   24.14 -export VERSION=0.2
   24.15 -export PROGNAME="SSHBox"
   24.16 -export PROG="$0"
   24.17 -export CONFIG_DIR=$HOME/.config/sshbox
   24.18 -export TEMP=/tmp/$(basename $PROG).out
   24.19 -
   24.20 -# Create $CONFIG_DIR if it doesn't exist.
   24.21 -[ -d $HOME/$CONFIG_DIR/session ] || mkdir -p $CONFIG_DIR/session
   24.22 -
   24.23 -# Set locale message if message file exists and $LANG is set.
   24.24 -# Default: English 
   24.25 -if [ -f /usr/share/locale/${LANG%%_*}/LC_MESSAGES/sshbox.msg ]; then
   24.26 -	. /usr/share/locale/${LANG%%_*}/LC_MESSAGES/sshbox.msg 
   24.27 -fi
   24.28 -
   24.29 -##
   24.30 -# Function
   24.31 -##
   24.32 -add_session(){
   24.33 -	export GTK_ADD_PROFILE="
   24.34 -		<window title=\"${TITLE_ADD_PROFILE:-Add new session}\" icon-name=\"sunny\">
   24.35 -			<vbox>
   24.36 -			<hbox>
   24.37 -				<text>
   24.38 -					<label>\"${LBL_SESSION:-Session}:\"</label>
   24.39 -				</text>
   24.40 -				<entry>
   24.41 -					<variable>SESSION</variable>
   24.42 -				</entry>
   24.43 -				</hbox>
   24.44 -				<hbox>
   24.45 -				<text>
   24.46 -					<label>\"${LBL_HOSTNAME:-Hostname}:\"</label>
   24.47 -				</text>
   24.48 -				<entry>
   24.49 -					<variable>SSH_HOST</variable>
   24.50 -				</entry>
   24.51 -
   24.52 -				</hbox>
   24.53 -				<hbox>
   24.54 -				<text>
   24.55 -					<default>22</default>
   24.56 -					<label>\"${LBL_PORT-Port}:\"</label>
   24.57 -				</text>
   24.58 -				<entry width_chars=\"5\" max-length=\"5\">
   24.59 -				<default>22</default>
   24.60 -					<variable>SSH_PORT</variable>
   24.61 -				</entry>
   24.62 -				</hbox>
   24.63 -				<hbox>
   24.64 -				<text>
   24.65 -					<label>\"${LBL_USERNAME-Username}:\"</label>
   24.66 -				</text>
   24.67 -				<entry>
   24.68 -					<variable>SSH_USER</variable>
   24.69 -				</entry>
   24.70 -				</hbox>
   24.71 -			<hbox>
   24.72 -			<button>
   24.73 -				<label>${BTN_SAVE:-Save}</label>
   24.74 -				<input file icon=\"gtk-floppy\"></input>
   24.75 -				<action>$PROG save_session $SESSION</action>
   24.76 -				<action>refresh:USER_HOST</action>
   24.77 -				<action type=\"exit\">Exit</action>
   24.78 -			</button>
   24.79 -				<button cancel></button>
   24.80 -			</hbox>
   24.81 -				</vbox>
   24.82 -		</window>
   24.83 -	"
   24.84 -	gtkdialog  --center --program=GTK_ADD_PROFILE
   24.85 -}
   24.86 -
   24.87 -gtk_manage_session(){
   24.88 -	
   24.89 -	# Read the config file if it exists
   24.90 -	[ -f "$CONFIG_DIR/session/$SESSION.conf" ] && . "$CONFIG_DIR/session/$SESSION.conf"
   24.91 -	
   24.92 -	export GTK_MANAGE_SESSION="
   24.93 -		<window title=\"${TITLE_GTK_MANAGE:-Session} $SESSION\" icon-name=\"gnome-control-center\">
   24.94 -		<vbox>
   24.95 -					<hbox>
   24.96 -				<text>
   24.97 -					<label>\"${LBL_HOSTNAME:-Hostname}:\"</label>
   24.98 -				</text>
   24.99 -				<entry>
  24.100 -					<input>\"echo $HOSTNAME\"</input>
  24.101 -					<variable>SSH_HOST</variable>
  24.102 -				</entry>
  24.103 -			</hbox>
  24.104 -			<hbox>
  24.105 -				<text>
  24.106 -					<default>22</default>
  24.107 -					<label>\"${LBL_PORT-Port}:\"</label>
  24.108 -				</text>
  24.109 -				<entry width_chars=\"5\" max-length=\"5\">
  24.110 -					<input>\"echo $PORT\"</input>
  24.111 -					<variable>SSH_PORT</variable>
  24.112 -				</entry>
  24.113 -			</hbox>
  24.114 -			<hbox>
  24.115 -					<text>
  24.116 -						<label>\"${LBL_USERNAME-Username}:\"</label>
  24.117 -					</text>
  24.118 -					<entry>
  24.119 -						<input>\"echo $USER\"</input>
  24.120 -						<variable>SSH_USER</variable>
  24.121 -					</entry>
  24.122 -			</hbox>
  24.123 -			
  24.124 -		<hbox>
  24.125 -			<button>
  24.126 -				<label>${BTN_DELETE:-Delete}</label>
  24.127 -				<input file icon=\"gtk-delete\"></input>
  24.128 -				<action>$PROG delete_session $SESSION</action>
  24.129 -			</button>
  24.130 -			<button>
  24.131 -				<label>${BTN_SAVE:-Modify}</label>
  24.132 -				<input file icon=\"gtk-floppy\"></input>
  24.133 -				<action>$PROG save_session</action>
  24.134 -			</button>
  24.135 -			<button>
  24.136 -				<label>${BTN_CONNECT:-Connect}</label>
  24.137 -				<input file icon=\"gtk-connect\"></input>
  24.138 -				<action>$PROG ssh_connect</action>
  24.139 -			</button>
  24.140 -			<button cancel></button>
  24.141 -		</hbox>
  24.142 -		</vbox>
  24.143 -		</window>
  24.144 -	"
  24.145 -	gtkdialog --center --program=GTK_MANAGE_SESSION
  24.146 -}
  24.147 -
  24.148 -
  24.149 -# Display SettingsBox.
  24.150 -gtk_settings(){
  24.151 -	read_settings
  24.152 -	export GTK_SETTINGS="
  24.153 -		<window title=\"${TITLE_GTK_SETTINGS:-Properties}\" icon-name=\"gnome-control-center\">
  24.154 -			<vbox>
  24.155 -				<hbox>
  24.156 -					<text use-markup=\"true\">
  24.157 -						<label>\"${TXT_TERM:-Terminal}: \"</label>
  24.158 -					</text>
  24.159 -					<entry>
  24.160 -						<input>echo $XTERM</input>
  24.161 -						<variable>XTERM</variable>
  24.162 -					</entry>
  24.163 -					</hbox>
  24.164 -					<hbox>
  24.165 -						<text use-markup=\"true\">
  24.166 -							<label>\"${TXT_SSH_CLIENT:-SSH Client}: \"</label>
  24.167 -						</text>
  24.168 -						<entry>
  24.169 -							<input>echo $SSH_CLIENT</input>
  24.170 -							<variable>SSH_CLIENT</variable>
  24.171 -						</entry>
  24.172 -					</hbox>
  24.173 -					<hbox>
  24.174 -						<button ok></button>
  24.175 -						<button cancel></button>
  24.176 -					</hbox>
  24.177 -				</vbox>
  24.178 -				</window>
  24.179 -		"
  24.180 -		gtkdialog --center --program=GTK_SETTINGS > /tmp/_out_
  24.181 -		
  24.182 -		. /tmp/_out_
  24.183 -		
  24.184 -		if [ "$EXIT" == "OK" ]; then
  24.185 -			save_settings
  24.186 -		fi
  24.187 -}
  24.188 -
  24.189 -gtk_gen_key(){
  24.190 -		# Gen private key with dropbearkey
  24.191 -		#
  24.192 -		export GTK_GEN_KEY="
  24.193 -		<window title=\"${TITLE_GTK_MANAGE:-Session} $SESSION\" icon-name=\"gnome-control-center\">
  24.194 -		<vbox>
  24.195 -			<hbox>
  24.196 -				
  24.197 -			</hbox>
  24.198 -			<hbox>
  24.199 -			<button>
  24.200 -				<label>${BTN_CONNECT:-Connect}</label>
  24.201 -				<input file icon=\"gtk-connect\"></input>
  24.202 -				<action>$PROG ssh_connect</action>
  24.203 -			</button>
  24.204 -			<button cancel></button>
  24.205 -			</hbox>
  24.206 -		</vbox>
  24.207 -		"
  24.208 -}
  24.209 -
  24.210 -ssh_genkey(){
  24.211 -	echo "nop"
  24.212 -}
  24.213 -
  24.214 -list_ssh_key(){
  24.215 -	
  24.216 -	# dropbearkey -y -f foo_dss  | awk '/ssh-(dss|rsa)/ { print $3 "|" $1}'
  24.217 -
  24.218 -	for i in ${HOME}/.ssh/*.priv
  24.219 -	do
  24.220 -		[ -f $i ] && echo $(basename $i .priv)
  24.221 -	done
  24.222 -}
  24.223 -
  24.224 -list_host(){
  24.225 -	if [ -f $HOME/.ssh/known_hosts ]; then
  24.226 -		for i in "$(cat $HOME/.ssh/known_hosts)"; do echo "$i"| awk '{print $1}';done
  24.227 -	fi
  24.228 -}
  24.229 -
  24.230 -delete_host(){
  24.231 -	cp $HOME/.ssh/known_hosts /tmp/f.tmp && \
  24.232 -	awk -v host=$KNOWN_HOST 'match($0,host) == 0 {print $0}' /tmp/f.tmp > $HOME/.ssh/known_hosts
  24.233 -}
  24.234 -
  24.235 -quick_add_session(){
  24.236 -			export GTK_QUICK_ADD="
  24.237 -				<window title=\"${TITLE_QUICK_ADD:-Enter session name}\" icon-name=\"gtk-dialog-question\">
  24.238 -				<vbox>
  24.239 -					<hbox>
  24.240 -					<text>
  24.241 -						<label>\"${TXT_SESSION_NAME:-Session}:\"</label>
  24.242 -					</text>
  24.243 -					<entry>
  24.244 -						<variable>SESSION</variable>
  24.245 -					</entry>
  24.246 -					</hbox>
  24.247 -					<hbox>
  24.248 -					<button>
  24.249 -						<label>${BTN_SAVE:-Save}</label>
  24.250 -						<input file icon=\"gtk-apply\"></input>
  24.251 -						<action type=\"exit\">OK</action>
  24.252 -					</button>
  24.253 -					<button cancel></button>
  24.254 -					</hbox>
  24.255 -				</vbox>
  24.256 -				</window>
  24.257 -		"
  24.258 -		gtkdialog  --center --program=GTK_QUICK_ADD > ${TEMP} 
  24.259 -		
  24.260 -		if ( grep -q  'EXIT="OK"' $TEMP ); then
  24.261 -				. $TEMP
  24.262 -				echo "HOSTNAME=${SSH_HOST}" > ${CONFIG_DIR}/session/${SESSION}.conf
  24.263 -				echo "USER=${SSH_USER}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  24.264 -				echo "PORT=${SSH_PORT}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  24.265 -		fi
  24.266 -}
  24.267 -
  24.268 -edit_session(){
  24.269 -	echo "nop"
  24.270 -}
  24.271 -
  24.272 -save_session(){
  24.273 -	echo "HOSTNAME=${SSH_HOST}" > ${CONFIG_DIR}/session/${SESSION}.conf
  24.274 -	echo "USER=${SSH_USER}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  24.275 -	echo "PORT=${SSH_PORT}" >> ${CONFIG_DIR}/session/${SESSION}.conf
  24.276 -}
  24.277 -
  24.278 -delete_session(){
  24.279 -	rm -f ${CONFIG_DIR}/session/${SESSION}.conf
  24.280 -}
  24.281 -
  24.282 -list_sessions(){
  24.283 -	
  24.284 -	for i in ${CONFIG_DIR}/session/*.conf
  24.285 -	do
  24.286 -		[ -f $i ] && echo "$(basename $i .conf)" | awk '{print"gtk-network|", $0}'
  24.287 -	done
  24.288 -}
  24.289 -
  24.290 -read_settings(){
  24.291 -	# Read user settings.
  24.292 -	# Init default settings if don't exist
  24.293 -	if [ -f ${CONFIG_DIR}/sshbox.conf ]; then
  24.294 -		. ${CONFIG_DIR}/sshbox.conf
  24.295 -	else
  24.296 -		echo "XTERM=xterm" > ${CONFIG_DIR}/sshbox.conf
  24.297 -		echo "SSH_CLIENT=ssh" >> ${CONFIG_DIR}/sshbox.conf
  24.298 -	fi
  24.299 -	export XTERM SSH_CLIENT 
  24.300 -}
  24.301 -
  24.302 -read_last_connection(){	
  24.303 -	# Read last connection
  24.304 -	[ -f $CONFIG_DIR/last ] &&  . $CONFIG_DIR/last
  24.305 -}	
  24.306 -
  24.307 -save_settings(){
  24.308 -	# Save user settings in user.pref.
  24.309 -	echo "XTERM=${XTERM:-xterm}" > $CONFIG_DIR/sshbox.conf
  24.310 -	echo "SSH_CLIENT=${SSH_CLIENT:-/usr/bin/ssh}" >> $CONFIG_DIR/sshbox.conf
  24.311 -}
  24.312 -
  24.313 -ssh_connect(){
  24.314 -	
  24.315 -	read_settings
  24.316 -	
  24.317 -	# TODO: Move this to another place
  24.318 -	# Save last used profile and start ssh connection
  24.319 -	echo "HOSTNAME=$SSH_HOST" > $CONFIG_DIR/last
  24.320 -	echo "USERNAME=$SSH_USER" >> $CONFIG_DIR/last
  24.321 -	echo "KEY=$SSH_KEY" >> $CONFIG_DIR/last
  24.322 -	
  24.323 -	$SSH_OPTIONS=""
  24.324 -	
  24.325 -	[ ! -z $SSH_PORT ] && SSH_OPTION="-p $SSH_PORT"
  24.326 -	
  24.327 -	# set terminal options
  24.328 -	if [ "$XTERM" ==  "sakura" ]; then
  24.329 -		OPTION="--title $SSH_USER@$SSH_HOST"
  24.330 -	else 
  24.331 -		OPTION="-T $SSH_USER@$SSH_HOST"
  24.332 -	fi
  24.333 -	
  24.334 -	exec $XTERM $OPTION -e "$SSH_CLIENT $SSH_OPTIONS $SSH_USER@$SSH_HOST" &
  24.335 -}
  24.336 -
  24.337 -gtk_about(){
  24.338 -		export GTK_ABOUT="
  24.339 -				<window title=\"${TITLE_ABOUT:-About} the $PROGNAMENAME\" icon-name=\"sunny\">
  24.340 -				<vbox>
  24.341 -					<pixmap>
  24.342 -						<input file stock=\"gtk-network\"></input>
  24.343 -					</pixmap>
  24.344 -					<text use-markup=\"true\">
  24.345 -					<label>\"<b>SSHBox v$VERSION</b>\"</label>
  24.346 -					</text>
  24.347 -					<text wrap=\"true\" width-chars=\"40\" use-markup=\"true\">
  24.348 -						<label>\"
  24.349 -Gtkdialog box interface for SSH connections.
  24.350 -
  24.351 -		SliTaz GNU/Linux - GPL v3
  24.352 -						\"
  24.353 -						</label>
  24.354 -					</text>
  24.355 -					<hbox><button ok></button></hbox>
  24.356 -				</vbox>
  24.357 -				</window>
  24.358 -		"
  24.359 -		gtkdialog  --center --program=GTK_ABOUT 
  24.360 -}
  24.361 -
  24.362 -main_dialog(){
  24.363 -	
  24.364 -	read_settings
  24.365 -	read_last_connection
  24.366 -	
  24.367 -export MAIN_DIALOG=" \
  24.368 -<window title=\"SSHBox\" icon-name=\"gtk-network\" resizable=^\"false\">
  24.369 - <vbox>  
  24.370 -	<hbox homogeneous=\"true\">
  24.371 -	<text  width-chars=\"60\">
  24.372 -		<label>\"\"</label>
  24.373 -	</text>
  24.374 -	</hbox>
  24.375 -	<notebook labels=\"${TITLE_MAIN:-Main}|${TITLE_SESSION:-Sessions}|${TITLE_HOST:-Host key}\">
  24.376 -	
  24.377 -	<vbox>  
  24.378 -		<hbox spacing=\"43\">
  24.379 -			<text use-markup=\"true\" >
  24.380 -				<label>\"${TXT_HOST:-Host}:\"</label>
  24.381 -			</text>
  24.382 -			<entry>
  24.383 -				<default>\"$HOSTNAME\"</default>
  24.384 -				<variable>SSH_HOST</variable>
  24.385 -			</entry>
  24.386 -		</hbox>
  24.387 -		<hbox>
  24.388 -			<text use-markup=\"true\">
  24.389 -				<label>\"${TXT_USER:-Username}:\"</label>
  24.390 -			</text>
  24.391 -			<entry>
  24.392 -				<default>\"$USERNAME\"</default>
  24.393 -				<variable>SSH_USER</variable>
  24.394 -			</entry>
  24.395 -		</hbox>
  24.396 -		<hbox  spacing=\"20\">
  24.397 -			<text use-markup=\"true\">
  24.398 -				<label>\"${TXT_KEY:-SSH Key}:\"</label>
  24.399 -			</text>
  24.400 -			<entry>
  24.401 -				<default>\"\"</default>
  24.402 -				<variable>SSH_KEY</variable>
  24.403 -			</entry>
  24.404 -		</hbox>
  24.405 -		<hbox>
  24.406 -		<button>
  24.407 -			<label>${BTN_ADD:-Save session}</label>
  24.408 -			<input file icon=\"gtk-save\"></input>
  24.409 -			<action>$PROG quick_add_session</action>
  24.410 -			<action>refresh:SESSION</action>
  24.411 -		</button>
  24.412 -		<button>
  24.413 -			<label>${BTN_CONNECT:-Connect}</label>
  24.414 -			<input file icon=\"gtk-connect\"></input>
  24.415 -			<action>$PROG ssh_connect</action>
  24.416 -		</button>
  24.417 -		</hbox>
  24.418 -	</vbox>
  24.419 -	
  24.420 -	<vbox>
  24.421 -		<hbox>
  24.422 -			<tree headers_visible=\"false\" exported_column=\"0\">
  24.423 -				<width>200</width><height>150</height>
  24.424 -				<label>\"\"</label>
  24.425 -				<variable>SESSION</variable>
  24.426 -				<input stock_column=\"0\">$PROG list_sessions</input>
  24.427 -				<action>$PROG gtk_manage_session $SESSION</action>
  24.428 -				<action>refresh:SESSION</action>
  24.429 -			</tree>
  24.430 -		</hbox>
  24.431 -		<hbox>
  24.432 -			<text width-chars=\"45\">
  24.433 -				<label>
  24.434 -\"
  24.435 -Double click on session name to manage SSH session.
  24.436 -\"
  24.437 -				</label>
  24.438 -			</text>
  24.439 -		<button>
  24.440 -			<label>${BTN_ADD_SESSION:-Add session}</label>
  24.441 -			<input file icon=\"gtk-add\"></input>
  24.442 -			<action>$PROG add_session</action>
  24.443 -			<action>refresh:SESSION</action>
  24.444 -		</button>
  24.445 -		</hbox>
  24.446 -	</vbox>
  24.447 -	
  24.448 -	<vbox>
  24.449 -		<hbox>
  24.450 -			<tree headers_visible=\"false\" exported_column=\"0\">
  24.451 -				<width>200</width><height>150</height>
  24.452 -				<label>\"\"</label>
  24.453 -				<variable>KNOWN_HOST</variable>
  24.454 -				<input>$PROG list_host</input>
  24.455 -				<action>$PROG delete_host $KNOWN_HOST</action>
  24.456 -				<action>refresh:KNOWN_HOST</action>
  24.457 -			</tree>
  24.458 -		</hbox>
  24.459 -		<hbox>
  24.460 -			<text width-chars=\"60\">
  24.461 -				<label>
  24.462 -\"Double click on host to remove it.\"
  24.463 -				</label>
  24.464 -			</text>
  24.465 -		</hbox>
  24.466 -	</vbox>
  24.467 -	</notebook> 
  24.468 -	 <hbox>
  24.469 -		<button>
  24.470 -			<label>${BTN_ABOUT:-About}</label>
  24.471 -			<input file icon=\"gtk-about\"></input>
  24.472 -			<action>$PROG gtk_about $PROGNAME</action>
  24.473 -		</button>
  24.474 -		<button>
  24.475 -			<label>${BTN_SETTINGS:-Settings}</label>
  24.476 -			<input file icon=\"gtk-preferences\"></input>
  24.477 -			<action>$0 gtk_settings</action>
  24.478 -		</button>
  24.479 -	 	<button>
  24.480 -			<label>${BTN_Exit:-Exit}</label>
  24.481 -			<input file icon=\"exit\"></input>
  24.482 -			<action type=\"exit\">Exit</action>
  24.483 -		</button>
  24.484 -	</hbox>
  24.485 - </vbox>
  24.486 -</window>
  24.487 -"
  24.488 -	gtkdialog --center --program=MAIN_DIALOG
  24.489 -}
  24.490 -
  24.491 -
  24.492 -
  24.493 -case $1 in 
  24.494 -	*_*)
  24.495 -		$1 ;;
  24.496 -	*)
  24.497 -		main_dialog	;;
  24.498 -esac
  24.499 -		
  24.500 -
  24.501 -