* Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
* Bug-Reports: see http://grml.org/bugs/
* License: This file is licensed under the GPL v2.
- * Latest change: Tue Mar 28 11:01:43 CEST 2006 [mika]
*******************************************************************************/
#include <stdio.h>
* Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
* Bug-Reports: see http://grml.org/bugs/
* License: This file is licensed under the GPL v2.
-* Latest change: Mit Jun 28 18:13:43 CEST 2006 [mika]
*******************************************************************************/
// return 0 if it is not running; return 1 if it is running
* Authors: grml-team (grml.org), (c) Michael Gebetsroither <gebi@grml.org>
* Bug-Reports: see http://grml.org/bugs/
* License: This file is licensed under the GPL v2.
- * Latest change: Thu Mar 30 23:09:28 CEST 2006 [mika]
*********************************************************************************/
#include <unistd.h>
* Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
* Bug-Reports: see http://grml.org/bugs/
* License: This file is licensed under the GPL v2.
- * Latest change: Die Sep 05 23:13:57 CEST 2006 [mika]
*******************************************************************************/
// diet gcc -s -Os -o reread_partition_table reread_partition_table.c
+grml-scripts (1.1.25) unstable; urgency=low
+
+ * Remove all bashisms.
+ * Drop grml-muttng as mutt-ng isn't maintained any longer and
+ we don't ship it since quite some time.
+ * Drop all 'Latest change' references.
+
+ -- Michael Prokop <mika@grml.org> Sat, 08 Aug 2009 00:46:21 +0200
+
grml-scripts (1.1.24) unstable; urgency=low
* grml-setlang: do not set $LANGUAGE and $LC_MESSAGES any longer,
Conflicts: scanmodem, grml-etc-core (<< 0.1-30)
Description: some small scripts which should make life easier
Some scripts which should make life easier. For example:
- code2color, grml-mutt, grml-muttng, grml-slrn,
- iimage, lesspipe.sh make_chroot_jail.sh, sepdate.pl,
- sepdate.rb, sepdate.sh*, wwwis.
+ code2color, grml-mutt, grml-slrn, iimage, lesspipe.sh
+ make_chroot_jail.sh, sepdate.pl, sepdate.rb, sepdate.sh*, wwwis.
.
Notice: not all the packages which are required in all the scripts
are in the "Depends:" line. If you want to get a full featured
/usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-init-screen.1.gz \
/usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-lock.1.gz \
/usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-mutt.1.gz \
- /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-muttng.1.gz \
/usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-nessus.1.gz \
/usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-postfix.1.gz \
/usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/grml-soundtest.1.gz \
lock virtual consoles
.SS grml-mutt
configuration script for mailclient mutt
-.SS grml-muttng
-configuration script for mailclient mutt-ng
.SS grml-resolution
change X resolution via a simple menu frontend
.SS grml-screen
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Die Aug 01 01:18:07 CEST 2006 [mika]
################################################################################
. /etc/grml/lsb-functions
-#!/bin/sh
+#!/bin/bash
# Filename: XF86AudioMute
# Purpose: mute and restore audio settings
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sun May 14 15:03:53 CEST 2006 [mika]
################################################################################
. /etc/grml/lsb-functions
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Die Aug 01 01:18:11 CEST 2006 [mika]
################################################################################
. /etc/grml/lsb-functions
# Authors: (c) Phil Gregory <phil_g@pobox.com>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: Taken from http://aperiodic.net/phil/configs/bin/attach-screen
-# Latest change: Thu Dec 01 14:30:24 CET 2005 [mika]
################################################################################
# -U option basically means "terminal does not have UTF-8 support"
# Authors: (C) Copyright 2004 Diomidis Spinellis
# Bug-Reports: see http://grml.org/bugs/
# License: See notes by author (Diomidis Spinellis).
-# Latest change: Sam Okt 16 22:54:03 CEST 2004 [mika]
################################################################################
# See http://www.dmst.aueb.gr/dds/blog/20040319/index.html
#
# Authors: grml-team (grml.org), (c) Matthias Kopfermann <maddi@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Don Nov 23 22:32:29 CET 2006 [mika]
################################################################################
if . /etc/grml/script-functions ; then
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Apr 20 00:06:21 CEST 2005 [mika]
################################################################################
if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ] ; then
# Authors: grml-team (grml.org), (C) Ubuntu, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Jul 04 12:15:57 CEST 2007 [mika]
################################################################################
# Notice: also check out /etc/init.d/loadcpufreq of current cpufrequtils in Debian.
#
;;
CentaurHauls*)
# VIA
- if [ $CPU_FAMILY == 6 ]; then
+ if [ $CPU_FAMILY = 6 ]; then
MODULE=longhaul;
fi
;;
# Authors: grml-team ( grml.org), (c) Matthias Kopfermann, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Nov 25 21:37:22 CET 2006 [mika]
################################################################################
zmodload zsh/files
# Authors: grml-team (grml.org), (c) Klaus Knopper, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Thu Oct 13 12:21:03 CEST 2005 [mika]
################################################################################
if [ -d "$1" ]; then
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Die Mai 03 17:05:35 CEST 2005 [mika]
################################################################################
xterm -e "vim $*"
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>, Wolfram Schlich <wschlich@gentoo.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Apr 14 10:59:02 CEST 2007 [mika]
################################################################################
# Notice: this file is based on:
# Copyright 1999-2006 Gentoo Foundation
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Fre Sep 29 13:56:15 CEST 2006 [mika]
################################################################################
-if ! type wget 1>&/dev/null 2>&1 ; then
- echo "Binary wget not available. Exiting." 1>&2
+if ! which wget >/dev/null 2>&1 ; then
+ echo "wget is not available. Exiting." 1>&2
exit 1
fi
# Purpose: grep for pattern and cut it
# Authors: Olaf Klischat <klischat@cs.tu-berlin.de>
# Bug-Reports: see http://grml.org/bugs/
-# Latest change: Fre Jän 07 10:41:17 CET 2005 [mika]
################################################################################
################################################################################
# Authors: grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Dec 05 11:12:49 CET 2005 [mika]
################################################################################
PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
MENU=$($DIALOG --stdout --clear --title "$PN" --menu \
"Configure userland tools." 0 0 0 \
"grml-mutt" "Configure the mutt MUA" \
-"grml-muttng" "Configuration of mutt next generation" \
"grml-slrn" "Configure the slrn newsreader" \
"exit" "Exit this program")
case $retval in
0)
- if [ $MENU == grml-mutt ]; then
+ if [ "$MENU" = "grml-mutt" ]; then
exec grml-mutt
fi
- if [ $MENU == grml-muttng ]; then
- exec grml-muttng
- fi
- if [ $MENU == grml-slrn ]; then
+ if [ "$MENU" = "grml-slrn" ]; then
exec grml-slrn
fi
- if [ $MENU == exit ]; then
+ if [ "$MENU" = "exit" ]; then
exit
fi
;;
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Jun 25 12:11:15 CEST 2005 [mika]
################################################################################
# export variable USER for use withing GNU screen:
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Mär 21 15:39:07 CET 2007 [mika]
################################################################################
# export variable USER for use withing GNU screen:
-#!/bin/sh
+#!/bin/bash
# Filename: grml-lang
# Purpose: load specific keyboard layout settings
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Jun 04 22:49:37 CEST 2007 [mika]
################################################################################
PN="$0"
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Don Jän 17 16:36:52 CET 2008 [mika]
################################################################################
PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Jul 25 18:37:29 CEST 2007 [mika]
################################################################################
# important variables - adjust them if necessary
+++ /dev/null
-#!/bin/sh
-# Filename: grml-muttng
-# Purpose: configuration script for mutt-ng
-# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
-# Bug-Reports: see http://grml.org/bugs/
-# License: This file is licensed under the GPL v2.
-# Latest change: Son Mär 18 17:15:16 CET 2007 [mika]
-################################################################################
-
-PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
-PN=$(basename "$0")
-
-if [ -r /etc/grml/script-functions ] ; then
- . /etc/grml/script-functions
- check4progs dialog muttng || echo "Warning - muttng is not available. Continuing anyway.">&2
-fi
-
-writemuttngrc() {
-cat > $MUTTRC << EOF
-# Filename: .muttngrc
-# Purpose: configuration for mailclient muttng, created by 'grml-muttng'
-# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
-# Bug-Reports: see http://grml.org/bugs/
-# License: This file is licensed under the GPL v2.
-# Latest change: Don Sep 21 20:00:07 CEST 2006 [mika]
-################################################################################
-
-## some general settings mutt understands:
-
-# important variables - adjust them if necessary
- set realname="$REALNAME"
- set from="$MAILADDR"
-
-# mailboxes
- set pop_host="$POP3"
-$POPDATA
- mailboxes $IMAP
-$IMAPDATA
-# some default options:
- set allow_8bit # send data as it is. no conversion.
- unset arrow_cursor # Show current mail with an inverse bar.
- set ascii_chars # set: use ASCII characters to build the thread tree
- set autoedit # call editor without prompting for To: and Subject:
- unset confirmappend # set: prompt for confirmation on appending mail to folder
- set confirmcreate # set: prompt for confirmation on creation of folders
- set copy # Always keep a copy of my mails!
- set delete=ask-yes # ask before deleting any messages
- set edit_headers # edit all headers lines in the editor
- set editor=vim # use Vim as the editor (Vi IMproved www.vim.org)
- set folder=~/Mail # directory with all mail folders
- unset followup_to # do not generate a Followup-To header
- set force_name # set: save outbound mail by username
- set hidden_host # do not use a hostname in the address - PROBLEMATIC!
- set history=100 # number of input lines for prompts to remember
- set include # set: include mail as quoted text in replies
- unset mark_old # set: make distinction between New mail and Old mail.
- set mime_forward=ask-yes # ask: attach message - or just quote it?
- unset move # do not move read mails from mailbox to $mbox (was: "set hold")
- set pager_context=1 # number of lines that overlap on paging
-# set pager_index_lines=0 # number of lines to see from the index
- set pager_stop # "next_page" won't jump to next message at end of messages
-# set print_command="mp|lpr" # pipe message to "mp" for formattting - then on to "lpr"
- unset prompt_after # set: gives you a prompt when pager exits
- set quote_regexp="^>" # some people just use '>' - *sigh*
- set read_inc=10 # '10': show count number for every tenth mail
- set recall=ask-yes # do not prompt for recalling postponed mails with 'm'
- set record=+outbox # outbox / where to save outgoing mails
- set reply_to=ask-yes # "reply": set: Use address in Reply-To?
- set reverse_alias # show the name of sender as set with my alias for him
- set reverse_name # reply as the user to whom the mail was sent to
- set save_name # set: save outbound mail to =username if it exists
-# set shell=zsh # use the zsh for shell commands
- set sort=threads # sorting method - I definitely like "threads" best
- set status_on_top # set: present the status bar at top, ie before the index
- set strict_threads # set: use references: for threading only, ie do not
- # thread by subject or in-reply-to
- set tilde # show non-existant lines of text with a tilde at begin-of-line
- set tmpdir="/tmp" # directory where temporary files are to be placed
- set to_chars="X+TCF" # message flags: non-personal,personal,To:,Cc:,From:
- set use_from # 'set from=' requires a 'set use_from'!
- set write_inc=10 # update number after each tenth read mail
-
-# Options with a long value:
-# set alternates=...
- set attribution="* %n <%a> [%(%y%m%d %H:%M)]:" # how to cite the author
- set reply_regexp="^((aw|antw.?|antwort|re|r e|r?f|sv):[ \t]*)*"
-
-# Format Options
- set forward_format="(forw) %s"
- set index_format="%4C %Z %[!%y%m%d] %-17.17F (%3l) %s"
- set pager_format="%S [%C/%T] %n (%l) %s"
- set status_format="%v: %f (%s) [%M/%m] [N=%n,*=%t,new=%b]"
-
-# Show the "text/plain" part *before* the "text/html" part:
- alternative_order text/plain text/html
- auto_view text/html
-
-# KEY BINDINGS
- bind index zt current-top
- bind index zz current-middle
- bind index zb current-bottom
-
-# HEADER DISPLAY
- ignore *
- unignore from: date: subject: to: cc: reply-to:
- unignore sender:
- unignore priority: importance:
- unignore organization organisation
- unignore mail-followup-to:
- unignore resent- x-resent
-# unignore user-agent: x-agent: x-mailer: x-newsreader: x-mailing-list:
-# unignore x-editor
-# unignore message-id: newsgroups: posted-to: posted-and-mailed:
-# unignore x-also-posted-to: x-newsgroups:
-# unignore delivered-to x-envelope-to:
-# unignore x-accept-language
- unhdr_order *
- hdr_order Sender: From From: Reply-To: Subject: Organization: Date: Message-Id: User-Agent: X-Editor: X-Mailer: X-Newsreader: X-Agent: To: Cc: Newsgroups: X-Resent Followup-To: Mail-Followup-To:
-
-## now the mutt-ng specific settings
-
-# path to header cache file:
- set header_cache="~/.muttng/cache"
-
-# sidebar stuff:
- set sidebar_visible="no"
- set sidebar_width=25
- set sidebar_shorten_hierarchy
- color sidebar_new yellow default
-
-# keybindings:
- bind index F flag-message
- bind pager F flag-message
-
- macro index z "c?\t" "List mailboxes and switch to selected one"
- macro index <f2> "<enter-command>set invsidebar_visible<enter>" "Toggle sidebar visibility"
- macro index \cW ':push <sidebar-prev-new><enter>' "Jump to previous mailbox with new messages in sidebar"
- macro index \cE ':push <sidebar-next-new><enter>' "Jump to next mailbox with new messages in sidebar"
- macro index \cP ':push <sidebar-prev><enter>' "Jump to previous mailbox in sidebar"
- macro index \cN ':push <sidebar-next><enter>' "Jump to next mailbox in sidebar"
- macro index \cO ':push <sidebar-open><enter>' "Open selected mailbox in sidebar"
-# bind index <space> sidebar-open
-
-EOF
-}
-
-lightcolors() {
-cat >> $MUTTRC << EOF
-
-## color setup
-
-## some misc stuff:
- color normal black white
- color error red white
- color indicator blue green
- color status white blue
- color tree blue white
- color hdrdefault red white
- color quoted blue white
- color quoted1 green white
- color quoted2 magenta white
- color quoted3 cyan white
- color tilde yellow black
- color signature blue white
- color search white blue # "search" - matches found with search within the internal pager.
- color markers red black # "markers" indicate a wrapped line when showing messages with looong lines.
- color bold green black
- color underline yellow black
-
-## index-colors:
- uncolor index *
-
-# mail from myself *and* to myself (TODO items):
-# color index black brightyellow '~p ~f prokop'
-
-# Flagged Messages are important!
- color index blue white ~N # New
- color index magenta default ~T # Tagged
- color index blue black ~D # Deleted Mails - use dark color as these are already "dealt with".
- color index red default ~O # old messages
-
-# mail from important people (like myself ;-):
-# color index white red '~f prokop'
-
-# Mails with no obvious addresses (empty To: and Cc: lines)
- color index cyan white "! ~C ."
-
-# "DONE mails" ie those I have already replied to.
- color index blue white '~Q'
-
-# non-multipart mails which are tex/html almost always are spam:
- color index brightmagenta white "~h 'Content-Type: text/html'"
-
-# Sent to "Undisclosed Recipients":
- color index white magenta '~C Undisclosed.*Recipients'
-
-# When the Subject indicates a reply (with ":re" but without "Fwd"!)
-# then there *must* be a reference to the previous message!
-# So if there is neither an In-Reply-To nor a References line
-# then it must have been sent with a crappy mailer....
- color index yellow white "~s re: ! ~s fwd: ! ~x . ! ~h 'in-reply-to: '"
-
-# No characters in body -> SPAM!
- color index white white "! ~b ."
-
- color index brightred black ~F # Flagged
-
-## body-colors:
-
-# highlight important keywords
- color body brightyellow black "grml"
-
-# URLs (General Internet addresses):
- color body yellow red "(finger|ftp|http|news|telnet)://[^ >]*"
- color body yellow red "<URL:[^ ]*>"
-# web address without "http":
- color body yellow red "www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?"
-
-# HTTPS addresses:
- color body yellow red "https://[^ >]*"
-
-# FTP addresses:
- color body yellow red "ftp://[^ ]*"
-
-# HTTP addresses:
- color body yellow red "[[:alnum:]][-+.#_[:alnum:]]*@[-+.[:alnum:]]*[[:alnum:]]"
-
-# File names ("/path/file")
-# color body brightgreen white "\\~?\(/[-_.,a-zA-Z0-9{}äöüß]+\)+"
- color body blue white "\\~?\(/[-_.,a-zA-Z0-9{}äöüß]+\)+"
-
-# Path names ("/path/")
- color body brightred white "\(/[-_.a-zA-Z0-9]+\)+/"
-
-# Variables ("$HOME")
- color body brightmagenta white "\\$[a-zA-Z][-_a-zA-Z]+"
-
-# Attribution line:
-# color body red white "^[*] .*:$"
-
-## abbreviations and "SCREAMING IN CAPS" in body:
-# The following includes umlauts - but that's quite clunky.
-# color body brightyellow red "[A-ZÄÖÜ][-A-ZÄÖÜ]+[A-ZÄÖÜ][ .!?]?"
-
-# "+USE_GNU_REGEX":
-# When you use "+USE_GNU_REGEX" then you can also make use
-# of "start of word" ("\<") and "end of word" ("\>"):
- color body red white "\\<[-A-Z']{3,}\\>"
-
-# *Emphasized*, /emphasized/, and _emphasized_ words:
-# color body brightred black "[*/_]+ *[- &[:alnum:]]+ *[*/_]+"
-# this would catch false positives of the kind _foo* and /bar_
-# so we should choose matching pairs only:
- color body brightred white "[*][-[:alnum:]]+[*]"
- color body brightred white "/[-[:alnum:]]+/"
- color body brightred white "_[-[:alnum:]]+_"
-
-# Smileys: :-) ;-) :-| :-/ :-(
- color body brightyellow white "[;:]-[)/(|]"
-# Grinning: "grin" ([g]) and "big grin" ([bg]):
- color body blue red "<[Gg]>"
- color body blue red "<[Bb][Gg]>"
-
-# Border Lines of length three or more.
-# (Several Newsletters use border lines..)
- color body green white "[-_=+~/\*]{3,}"
-
-# Extensive use of exclamation and question marks:
-# "!!!" "???"
- color body red white "[!?]{3,}"
-
-# Percentages ("Save xx.x %!")
- color body brightgreen white "[.0-9]+ ?%"
-
-# Copyright (C) and Registered Trademark (r)
- color body red white "[(][cr][)]"
- color body red white "\\(c\\)"
-
-# Year Numbers 1980-2002
- color body blue white "19[89][0-9]"
- color body blue white "200[012]"
-
-# Phone Numbers:
- color body blue white "1-[0-9]{3}[- ][-0-9]+ +ext.? [0-9]+"
- color body blue white \
-"(tele)?(cell|fax|fon|phone|tel)[.: ]+[+]?[- 0-9/()]{4,}[0-9]"
-
-# RTFM!
-# " man word"
- color body white red "^ +[$]? *man \\w+"
-
-# Lists
-# bulleted list:
-# * one
-# * two
-# * three
-# dashed list:
-# - one
-# - two
-# - three
-# color body red black "^ *[-*] +"
-# this pattern yields many false positives as it
-# spans lines for which there is no syntax language.
-# this is easier with Vim's syntax coloring.
- color body red white "^ *[-*] +"
-
-# special IP host addresses:
-# 192.x.x.x
- color body white blue "129.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"
- color body white blue "193.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"
-
-# HTML tags
- color body yellow black "</?\w+>"
-
-# Emphasis by interspersed spaces
-# Example: E M P H A S I S
- color body red white '\<\w( +\w\>)+'
-
-# verbatim marks (#v+ till #v-)
- color body yellow red ^\#v[-+]
-
- color attachment black white
-EOF
-}
-
-dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
-
-This script will create a simple base
-configuration for the mailclient mutt-ng.
-
-Report bugs, send wishes and feedback to the grml team:
-http://www.grml.org/ - contact (at) grml.org
-" 13 65
-
-GETREALNAME=$(dialog --stdout --title "$PN" --inputbox "Your real name (eg 'John GRML User'):" 0 56) || exit 0
-REALNAME=${GETREALNAME%/*}
-
-GETMAILADDR=$(dialog --stdout --title "$PN" --inputbox "Your main mail address (eg 'joedoe@grml.org'):" 0 56) || exit 0
-MAILADDR=${GETMAILADDR%/*}
-
-askpop(){
- GETPOPUSER=$(dialog --stdout --title "$PN" --inputbox "Enter username for POP3 account" 0 0)
- POPUSER=${GETPOPUSER}
-
- GETPOPPWD=$(dialog --stdout --title "$PN" --passwordbox "Enter password for POP3 account (typing hidden)" 0 0)
- POPPWD=${GETPOPPWD}
-}
-
-ASKPOP=$(dialog --stdout --title "$PN" --yesno "Configure POP3?" 0 0)
-retval=$?
-
-case $retval in
- 0)
- GETPOP3=$(dialog --stdout --title "$PN" --inputbox "Your POP3 account (pop[s]://[user]@hostname[:port]):" 0 56 "pop://") || exit 0
- POP3=${GETPOP3}
- askpop && \
-POPDATA=" set pop_user=\"$POPUSER\"
- set pop_pass=\"$POPPWD\"
-"
- ;;
-esac
-
-askimap(){
- GETIMAPUSER=$(dialog --stdout --title "$PN" --inputbox "Enter username for IMAP account" 0 0)
- IMAPUSER=${GETIMAPUSER}
-
- GETIMAPPWD=$(dialog --stdout --title "$PN" --passwordbox "Enter password for IMAP account (typing hidden)" 0 0)
- IMAPPWD=${GETIMAPPWD}
-}
-
-ASKIMAP=$(dialog --stdout --title "$PN" --yesno "Configure IMAP?" 0 0)
-retval=$?
-
-case $retval in
- 0)
- GETIMAP=$(dialog --stdout --title "$PN" --inputbox "Your IMAP account (imap[s]://[user@]hostname[:port]/mailbox):" 0 65 "imap://") || exit 0
- IMAP=${GETIMAP}
- askimap && \
-IMAPDATA=" set imap_user=\"$IMAPUSER\"
- set imap_pass=\"$IMAPPWD\"
-"
- ;;
-esac
-
-GETCOLOR=$(dialog --stdout --title "$PN" \
- --radiolist "Which color setup do you want to use?" 10 65 2 \
- dark "dark color setup (default)" on \
- light "light color setup" off)
-retval=$?
-
-case $retval in
- 0) COLOR=$GETCOLOR ;;
- *) exit 1 ;;
-esac
-
-writecolors() {
- if [ "$COLOR" = 'light' ] ; then
- lightcolors
- fi
-}
-
-GETMUTTRC=$(dialog --stdout --title "$PN" --inputbox "Choose a filename for this configuration:" 0 56 "$HOME/.muttngrc") || exit 0
-MUTTRC=${GETMUTTRC}
-
-WRITEMUTTRC=$(dialog --stdout --title "$PN" --yesno "Write $MUTTRC?" 5 65)
-retval=$?
-
-case $retval in
- 0)
- [ -d ~/.muttng ] || mkdir ~/.muttng
- if [ -f "$MUTTRC" ] ; then
- dialog --stdout --title "$PN" --yesno "$MUTTRC exists. Overwrite?" 5 65
- retval=$?
- case $retval in
- 0)
- writemuttngrc && writecolors && \
- dialog --stdout --title "$PN" --msgbox "Writing $MUTTRC was successful." 7 65 || \
- { dialog --stdout --title "$PN" --msgbox "Error $?: writing $MUTTRC failed." 7 65 ; exit 1 ; }
- ;;
- esac
- else
- writemuttngrc && writecolors && \
- dialog --stdout --title "$PN" --msgbox "Writing $MUTTRC was successfull." 7 65 || \
- { dialog --stdout --title "$PN" --msgbox "Error $?: writing $MUTTRC failed." 7 65 ; exit 1 ; }
- fi
- ;;
-esac
-
-dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
-
-More information on mutt-ng:
-
-Manuals: man 1 muttng
- man 5 muttngrc
-
-Webpages:
-http://mutt-ng.berlios.de/
-http://mutt-ng.supersized.org/
-
-#######################################################
-
-Report bugs, send wishes and feedback to the grml team:
-http://www.grml.org/ - contact (at) grml.org
-" 24 65
-
-## END OF FILE #################################################################
-#!/bin/sh
+#!/bin/bash
# Filename: grml-resolution
# Purpose: change X resolution via a simple menu frontend
# Authors: Florian Keller <florian.keller@zuerich.ch>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Thu May 04 23:13:39 CEST 2006 [mika]
################################################################################
PN=$(basename $0)
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Mär 21 15:39:00 CET 2007 [mika]
################################################################################
# export variable USER for use withing GNU screen:
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Son Mär 18 17:23:34 CET 2007 [mika]
################################################################################
PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
% Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
% Bug-Reports: see http://grml.org/bugs/
% License: This file is licensed under the GPL v2.
-% Latest change: Son Nov 28 22:38:30 CET 2004 [mika]
%###############################################################################
%###############################################################################
mono quotes6 "underline"
mono quotes7 "underline"
mono response_char "bold"
-mono selection "bold"
+mono selection "bold"
mono signature "none"
mono status "reverse"
mono subject "none"
retval=$?
case $retval in
- 0)
+ 0)
if [ -f "$SLRNRC" ] ; then
dialog --stdout --title "$PN" --yesno "$SLRNRC exists. Overwrite?" 5 65
retval=$?
case $retval in
- 0)
+ 0)
writeslrnrc && writecolors && \
dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successful." 7 65 || \
{ dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65 ; exit 1 ; }
retval=$?
case $retval in
- 0)
+ 0)
slrn -create -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC && \
echo "
Start slrn with taken settings via:
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Fre Jul 07 22:42:40 CEST 2006 [mika]
################################################################################
BROWSER=${BROWSER:-w3m}
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Jän 10 23:40:04 CET 2007 [mika]
################################################################################
use strict;
# Authors: Oliver Kiddle (<URL:http://www.zsh.org/mla/workers/2001/msg00390.html>)
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Mai 27 15:12:27 CEST 2006 [mika]
################################################################################
if (( ! $# )); then
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Mär 17 19:56:13 CET 2007 [mika]
################################################################################
isutfenv() {
# Authors: Joey Hess <joey@kitenet.net>
# Bug-Reports: see http://grml.org/bugs/
# License: Unknown (origin: see http://svn.kitenet.net/trunk/bin/logview)
-# Latest change: Fri Sep 16 18:19:05 CEST 2005 [mika]
################################################################################
$|=1;
# Authors: grml-team (grml.org), (c) Alexander Wirt <formorer@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Aug 07 23:39:32 CEST 2006 [mika]
################################################################################
# little helper functions that skips the httpheader of a site
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>, Matthias Kopfermann <maddi@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Don Sep 20 21:56:52 CEST 2007 [mika]
################################################################################
. /etc/grml/lsb-functions
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Dez 02 20:30:20 CET 2006 [mika]
################################################################################
num=$(wc -l $0)
num=${num%% $0}
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Die Feb 06 20:38:24 CET 2007 [mika]
################################################################################
if [ $# -eq 0 ] ; then
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Jän 19 17:08:34 CET 2008 [mika]
################################################################################
PN=`basename "$0"`
# Authors: Wolfgang Scheicher <worf@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Apr 25 10:38:00 CEST 2005 [worf]
################################################################################
# Defaults
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Feb 26 2005 [mika]
################################################################################
# This script will replace all the unsighted unprintable characters bleached out of your source file by a:
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Fre Jul 14 01:29:42 CEST 2006 [mika]
################################################################################
if [ -x /usr/bin/sselp ] ; then # package dwm-tools
-#!/bin/sh
+#!/bin/bash
# Filename: zsh-login
# Purpose: customized zsh login welcome screen for use at grml
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Son Mär 09 15:11:56 CET 2008 [mika]
################################################################################
. /etc/grml/sh-lib
# Authors: (C) 2001 by Till Kamppeter
# Bug-Reports: see http://grml.org/bugs/
# License: Free software under the terms of the GNU General Public License (GPL)
-# Latest change: Son Mär 18 19:31:15 CET 2007 [mika]
################################################################################
# Downloaded from http://www.linuxprinting.org/download/printing/alignmargins
exit 1
fi
-if [ $UID != 0 ] ; then
+if [ "$(id -ru)" != "0" ] ; then
echo Error: become root before starting $0 >& 2
exit 100
fi
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Jän 14 20:36:21 CET 2008 [mika]
################################################################################
. /etc/grml/lsb-functions
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Die Aug 08 19:58:41 CEST 2006 [mika]
################################################################################
. /etc/grml/lsb-functions
-if [ $UID != 0 ] ; then
+if [ "$(id -ru)" != "0" ] ; then
eerror "Need root privileges. Please run $0 as user root." ; eend 1
exit 1
fi
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Don Jul 26 17:21:31 CEST 2007 [mika]
################################################################################
# Ressources:
# http://apt-get.dk/howto/backup/
# TODO / integrate?
cronsetup() {
- test -f ~/.keychain/`uname -n`-sh && source ~/.keychain/`uname -n`-sh
+ test -f ~/.keychain/`uname -n`-sh && . ~/.keychain/`uname -n`-sh
}
get_backup_dir() {
# Authors: grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Dec 05 11:12:59 CET 2005 [mika]
################################################################################
PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
DIALOG=$(which dialog)
PN=$(basename $0)
-if [ $UID != 0 ] ; then
+if [ "$(id -ru)" != "0" ] ; then
DEFAULTITEM=user
else
DEFAULTITEM=root
case $retval in
0)
- if [ $MENU == root ]; then
+ if [ "$MENU" = "root" ]; then
exec grml-config-root
fi
- if [ $MENU == user ]; then
+ if [ "$MENU" = "user" ]; then
exec grml-config-user
fi
- if [ $MENU == exit ]; then
+ if [ "$MENU" = "exit" ]; then
exit
fi
;;
# Authors: grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Jul 26 19:18:09 CEST 2006 [mika]
################################################################################
PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
DIALOG=`which dialog`
PN=$(basename $0)
-if [ $UID != 0 ]
-then
+if [ "$(id -ru)" != "0" ] ; then
$DIALOG --msgbox "Error: $0 requires root permissions. Exiting." 0 0
exit 100
fi
case $retval in
0)
- if [ $MENU == grml-hostname ]; then
+ if [ "$MENU" = "grml-hostname" ]; then
exec grml-hostname
fi
- if [ $MENU == grml-setlang ]; then
+ if [ "$MENU" = "grml-setlang" ]; then
exec grml-setlang
fi
- if [ $MENU == grml-setkeyboard ]; then
+ if [ "$MENU" = "grml-setkeyboard" ]; then
exec grml-setkeyboard
fi
- if [ $MENU == grml-nessus ]; then
+ if [ "$MENU" = "grml-nessus" ]; then
exec grml-nessus
fi
- if [ $MENU == grml-network ]; then
+ if [ "$MENU" = "grml-network" ]; then
exec grml-network
fi
- if [ $MENU == grml-postfix ]; then
+ if [ "$MENU" = "grml-postfix" ]; then
exec grml-postfix
fi
- if [ $MENU == grml-terminalserver ]; then
+ if [ "$MENU" = "grml-terminalserver" ]; then
exec grml-terminalserver
fi
- if [ $MENU == suspenduser ]; then
+ if [ "$MENU" = "suspenduser" ]; then
exec suspenduser_gui.sh
fi
- if [ $MENU == exit ]; then
+ if [ "$MENU" = "exit" ]; then
exit
fi
;;
# Authors: (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest Change: Thu Jan 29 15:56:54 CET 2009
################################################################################
. /etc/grml/script-functions
case "$1" in -h|--help) echo "Usage: $0 [hostname]">&2; exit 1 ;; esac
if [ -n "$1" ] ; then
- HOSTNAME="$1"
+ NEW_HOSTNAME="$1"
NONINTERACTIVE=1
else
if [ -x /usr/bin/random-hostname ] ; then
- HOSTNAME="$(/usr/bin/random-hostname)"
+ NEW_HOSTNAME="$(/usr/bin/random-hostname)"
else
- HOSTNAME="$(hostname)"
+ NEW_HOSTNAME="$(hostname)"
fi
fi
if [ -z "$NONINTERACTIVE" ] ; then
- HOSTNAME="$(dialog --stdout --title "${PN}" --extra-button --extra-label "Propose hostname" \
+ NEW_HOSTNAME="$(dialog --stdout --title "${PN}" --extra-button --extra-label "Propose hostname" \
--inputbox "Set hostname (/etc/hostname, /etc/hosts and /etc/postfix/main.cf will be adjusted)\
-\n\nTip: press 'Propose hostname' for another proposal" 14 70 $HOSTNAME)"
+\n\nTip: press 'Propose hostname' for another proposal" 14 70 $NEW_HOSTNAME)"
retval=$?
else
retval=0
case $retval in
0)
- echo "$HOSTNAME" > /etc/hostname
- echo "$HOSTNAME" > /etc/mailname
- sed -i "s/^127.0.0.1[ \t]*$OLDHOSTNAME[ \t]*localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts
- sed -i "s/^::1[ \t]*ip6-localhost ip6-loopback[ \t]*$OLDHOSTNAME/::1 ip6-localhost ip6-loopback $HOSTNAME/" /etc/hosts
+ echo "$NEW_HOSTNAME" > /etc/hostname
+ echo "$NEW_HOSTNAME" > /etc/mailname
+ sed -i "s/^127.0.0.1[ \t]*$OLDHOSTNAME[ \t]*localhost/127.0.0.1 $NEW_HOSTNAME localhost/" /etc/hosts
+ sed -i "s/^::1[ \t]*ip6-localhost ip6-loopback[ \t]*$OLDHOSTNAME/::1 ip6-localhost ip6-loopback $NEW_HOSTNAME/" /etc/hosts
POSTFIX=''
if [ -r /etc/postfix/main.cf ] ; then
- sed -i "s/^mydestination = .*/mydestination = $HOSTNAME, localhost, localhost.localdomain/" /etc/postfix/main.cf && \
- sed -i "s/^myhostname = .*/myhostname = $HOSTNAME/" /etc/postfix/main.cf && POSTFIX='
+ sed -i "s/^mydestination = .*/mydestination = $NEW_HOSTNAME, localhost, localhost.localdomain/" /etc/postfix/main.cf && \
+ sed -i "s/^myhostname = .*/myhostname = $NEW_HOSTNAME/" /etc/postfix/main.cf && POSTFIX='
Configuration of myhostname in /etc/postfix/main.cf has been adjusted as well. Do not forget to restart postfix if necessary.'
fi
if [ -z "$NONINTERACTIVE" ] ; then
- dialog --stdout --title "${PN}" --msgbox "Setting hostname to $HOSTNAME was successful.$POSTFIX" 0 0
+ dialog --stdout --title "${PN}" --msgbox "Setting hostname to $NEW_HOSTNAME was successful.$POSTFIX" 0 0
else
- echo "Setting hostname to $HOSTNAME: done"
+ echo "Setting hostname to $NEW_HOSTNAME: done"
fi
exit 0
;;
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Don Okt 12 17:20:59 CEST 2006 [mika]
################################################################################
. /etc/grml/script-functions
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon Sep 11 17:31:07 CEST 2006 [mika]
################################################################################
PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Thu Apr 27 18:26:46 CEST 2006 [mika]
################################################################################
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
LANG=C
LC_ALL=C
-if [ $UID != 0 ] ; then
+if [ "$(id -ru)" != "0" ] ; then
echo Error: become root before starting $0 >& 2
exit 100
fi
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Sep 05 19:06:41 CEST 2007 [mika]
################################################################################
PN="$(basename $0)"
esac
# read in the file where all the $LANGUAGE stuff is defined
- source /etc/grml/language-functions
+ . /etc/grml/language-functions
cat > /etc/sysconfig/keyboard <<EOF
# File generated by $PN on $(date)
fi
# read in the file where all the $LANGUAGE stuff is defined
- source $LANGFUNC
+ . $LANGFUNC
# make sure the file exists
if ! [ -r $CONFFILE ] ; then
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Jul 25 18:34:57 CEST 2007 [mika]
################################################################################
PN="$(basename $0)"
exit 0
}
-trap bailout 1 2 3 15
+trap bailout SIGHUP SIGINT SIGQUIT SIGTERM
is_value_set(){
[ -n "$1" ] || return 2
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Son Nov 26 18:04:13 CET 2006 [mika]
################################################################################
set -e # exit on any error
# Authors: (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Jul 26 02:26:06 CEST 2006 [mika]
################################################################################
. /etc/grml/lsb-functions
# Authors: (c) Michael Schierl <schierlm-public@gmx.de>, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Son Sep 30 16:04:17 CEST 2007 [mika]
################################################################################
set -e
#
# Feedback is welcome!
#
-# Thanks for Bugfixes / Enhancements to
+# Thanks for Bugfixes / Enhancements to
# Michael Prokop <http://www.michael-prokop.at/chroot/>,
# Randy K., Randy D. and Jonathan Hunter.
fi
echo "Am I root? "
-if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
+if [ "$(whoami 2>/dev/null)" != "root" ] && [ "$(id -un 2>/dev/null)" != "root" ] ; then
echo " NO!
Error: You must be root to run this script."
fi
# Check existence of necessary files
-echo "Checking for which... "
+echo "Checking for which... "
if ( test -f /usr/bin/which ) || ( test -f /bin/which ) || ( test -f /sbin/which ) || ( test -f /usr/sbin/which );
then echo " OK";
else echo " failed
exit 1
fi
-echo "Checking for chroot..."
+echo "Checking for chroot..."
if [ `which chroot` ];
then echo " OK";
else echo " failed
exit 1
fi
-echo "Checking for sudo..."
+echo "Checking for sudo..."
if [ `which sudo` ]; then
echo " OK";
-else
+else
echo " failed
sudo not found!
exit 1
fi
-echo "Checking for dirname..."
+echo "Checking for dirname..."
if [ `which dirname` ]; then
echo " OK";
-else
+else
echo " failed
dirname not found!
exit 1
fi
-echo "Checking for awk..."
+echo "Checking for awk..."
if [ `which awk` ]; then
echo " OK
";
-else
+else
echo " failed
awk not found!
# (uncommented) line with sftp-server filename. If neither exists, just skip
# this step and continue without sftp-server
#
-if (test ! -f /etc/ssh/sshd_config &> /dev/null); then
+if (test ! -f /etc/ssh/sshd_config >/dev/null 2>&1); then
echo "
File /etc/ssh/sshd_config not found.
Not checking for path to sftp-server.
";
else
- if !(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server &> /dev/null); then
+ if !(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server >/dev/null 2&1); then
echo "Obviously no sftp-server is running on this system.
";
else SFTP_SERVER=$(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server | awk '{ print $3}')
fi
fi
-#if !(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server /etc/ssh/sshd_config | awk '{ print $3}' &> /dev/null); then
+#if !(grep -v "^#" /etc/ssh/sshd_config | grep -i sftp-server /etc/ssh/sshd_config | awk '{ print $3}' >/dev/null 2&1); then
APPS="$APPS $SFTP_SERVER"
# Get accountname to create
if ( id $CHROOT_USERNAME > /dev/null 2>&1 ) ; then {
echo "
-----------------------------
-User $CHROOT_USERNAME exists.
+User $CHROOT_USERNAME exists.
Are you sure you want to modify the users home directory and lock him into the
chroot directory?
Are you REALLY sure?
-Say only yes if you absolutely know what you are doing!"
- read -p "(yes/no) -> " MODIFYUSER
+Say only yes if you absolutely know what you are doing!
+(yes/no) -> "
+ read MODIFYUSER
if [ "$MODIFYUSER" != "yes" ]; then
echo "
Not entered yes. Exiting...."
if [ -f ${SHELL} ] ; then
echo "
-----------------------------
-The file $SHELL exists.
+The file $SHELL exists.
Probably it was created by this script.
Are you sure you want to overwrite it?
(you want to say yes for example if you are running the script for the second
-time when adding more than one account to the jail)"
-read -p "(yes/no) -> " OVERWRITE
+time when adding more than one account to the jail)
+(yes/no) -> "
+read OVERWRITE
if [ "$OVERWRITE" != "yes" ]; then
echo "
Not entered yes. Exiting...."
[ -r $JAILPATH/dev/urandom ] || mknod $JAILPATH/dev/urandom c 1 9
[ -r $JAILPATH/dev/null ] || mknod -m 666 $JAILPATH/dev/null c 1 3
[ -r $JAILPATH/dev/zero ] || mknod -m 666 $JAILPATH/dev/zero c 1 5
-[ -r $JAILPATH/dev/tty ] || mknod -m 666 $JAILPATH/dev/tty c 5 0
+[ -r $JAILPATH/dev/tty ] || mknod -m 666 $JAILPATH/dev/tty c 5 0
# if we only want to update the files in the jail
# skip the creation of the new account
# $HOME to $JAILPATH/home/*
if [ "$CREATEUSER" != "yes" ] ; then echo "
Not creating new User account
-Modifying User \"$CHROOT_USERNAME\"
+Modifying User \"$CHROOT_USERNAME\"
Copying files in $CHROOT_USERNAME's \$HOME to \"$HOMEDIR\"
"
usermod -d "$HOMEDIR" -m -s "$SHELL" $CHROOT_USERNAME && chmod 700 "$HOMEDIR"
fi
# grep the username which was given to us from /etc/passwd and add it
-# to ./etc/passwd replacing the $HOME with the directory as it will then
+# to ./etc/passwd replacing the $HOME with the directory as it will then
# appear in the jail
echo "Adding User $CHROOT_USERNAME to jail"
grep -e "^$CHROOT_USERNAME:" /etc/passwd | \
echo "Copying necessary library-files to jail (may take some time)"
# The original code worked fine on RedHat 7.3, but did not on FC3.
-# On FC3, when the 'ldd' is done, there is a 'linux-gate.so.1' that
+# On FC3, when the 'ldd' is done, there is a 'linux-gate.so.1' that
# points to nothing (or a 90xb.....), and it also does not pick up
# some files that start with a '/'. To fix this, I am doing the ldd
# to a file called ldlist, then going back into the file and pulling
# out the libs that start with '/'
-#
+#
# Randy K.
#
# The original code worked fine on 2.4 kernel systems. Kernel 2.6
-# introduced an internal library called 'linux-gate.so.1'. This
-# 'phantom' library caused non-critical errors to display during the
-# copy since the file does not actually exist on the file system.
-# To fix re-direct output of ldd to a file, parse the file and get
+# introduced an internal library called 'linux-gate.so.1'. This
+# 'phantom' library caused non-critical errors to display during the
+# copy since the file does not actually exist on the file system.
+# To fix re-direct output of ldd to a file, parse the file and get
# library files that start with /
#
-if [ -x ${HOME}/ldlist ]; then
+if [ -x ${HOME}/ldlist ]; then
mv ${HOME}/ldlist ${HOME}/ldlist.bak
fi
-if [ -x ${HOME}/lddlist2 ]; then
+if [ -x ${HOME}/lddlist2 ]; then
mv ${HOME}/lddlist2 ${HOME}/lddlist2.bak
fi
# needed library just copy all of them)
#
#cp /lib/*.* ${JAILPATH}/lib/
-#cp /lib/lib64/*.* ${JAILPATH}/lib/lib64/
+#cp /lib/lib64/*.* ${JAILPATH}/lib/lib64/
# if you are using PAM you need stuff from /etc/pam.d/ in the jail,
echo "Copying files from /etc/pam.d/ to jail"
if [ -f /etc/DIR_COLORS ] ; then
cp /etc/DIR_COLORS ${JAILPATH}/etc/
-fi
+fi
# Don't give more permissions than necessary
chown root.root ${JAILPATH}/bin/su
# Authors: (c) Klaus Knopper Mar 2001, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Fre Apr 20 00:40:15 CEST 2007 [mika]
################################################################################
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
# Authors: (c) Martin Oehler 2004, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Fri Apr 21 22:22:12 CEST 2006 [mika]
################################################################################
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin"
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Thu Nov 10 23:18:35 CET 2005 [mika]
################################################################################
touch /etc/noeject
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Thu Nov 10 23:17:55 CET 2005 [mika]
################################################################################
touch /etc/noprompt
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Okt 06 13:23:35 CEST 2007 [mika]
################################################################################
if [ $UID != 0 ]; then
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Sam Okt 06 13:23:59 CEST 2007 [mika]
################################################################################
if [ $UID != 0 ]; then
# Purpose: suspend a user account for the indefinite future
# Authors: Dave Taylor / http://www.intuitive.com/wicked/showscript.cgi?045-suspenduser.sh
# Bug-Reports: see http://grml.org/bugs/
-# Latest change: Sun Jan 15 22:47:34 CET 2006 [mika]
################################################################################
homedir="/home" # home directory for users
# Purpose: dialog interface for suspend user
# Authors: grml-team (grml.org), (c) Nico Golde <nico@grml.org>, (c) Michael Prokop <mika@grml.org>
# License: This file is licensed under the GPL v2.
-# Latest change: Thu Jan 12 22:15:45 CET 2006 [mika]
################################################################################
PATH=${PATH:-'/usr/bin:/usr/sbin'}
exit 1
fi
-if [ "$1" = '-h' ] || [ "$1" == '--help' ] ; then
+if [ "$1" = '-h' ] || [ "$1" = '--help' ] ; then
cat << EOF
swspeak - script for activating software speak features