summaryrefslogtreecommitdiffstats
path: root/remote/tools/base/data/etc
diff options
context:
space:
mode:
authorJonathan Bauer2012-12-20 15:33:34 +0100
committerJonathan Bauer2012-12-20 15:33:34 +0100
commitf6dad6269ab3228ead055291b846d2a9edb04564 (patch)
tree30096a5fbd037fe4f9f0a0ef2b68d04317883c8e /remote/tools/base/data/etc
parentstatic unit files for dbus, cleanup (diff)
downloadtm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.tar.gz
tm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.tar.xz
tm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.zip
mltk basic script :)
Diffstat (limited to 'remote/tools/base/data/etc')
-rw-r--r--remote/tools/base/data/etc/profile57
-rw-r--r--remote/tools/base/data/etc/systemd/system/network-fast.service8
-rwxr-xr-xremote/tools/base/data/etc/udhcpc.default.script64
3 files changed, 129 insertions, 0 deletions
diff --git a/remote/tools/base/data/etc/profile b/remote/tools/base/data/etc/profile
new file mode 100644
index 00000000..3784e784
--- /dev/null
+++ b/remote/tools/base/data/etc/profile
@@ -0,0 +1,57 @@
+# ~/.bashrc: executed by bash(1) for non-login interactive shells.
+
+export PATH=\
+/bin:\
+/sbin:\
+/usr/bin:\
+/usr/sbin:\
+/openslx/bin:\
+/openslx/sbin:\
+/openslx/usr/bin:\
+/openslx/usr/sbin
+
+# If running interactively, then:
+if [ "$PS1" ]; then
+
+ if [ "$BASH" ]; then
+ export PS1="[\u@\h \W]\\$ "
+ alias ll='ls --color=auto -laFh'
+ alias ls='ls --color=auto -F'
+ export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
+ else
+ if [ "`id -u`" -eq 0 ]; then
+ export PS1='# '
+ else
+ export PS1='$ '
+ fi
+ fi
+
+ export USER=`id -un`
+ export LOGNAME=$USER
+ export HOSTNAME=`hostname`
+ export HISTSIZE=1000
+ export HISTFILESIZE=1000
+ export PAGER='/bin/more '
+ export EDITOR='/bin/vi'
+ export INPUTRC=/etc/inputrc
+ export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
+
+ ### Some aliases
+ alias ps2='ps facux '
+ alias ps1='ps faxo "%U %t %p %a" '
+ alias af='ps af'
+ alias cls='clear'
+ alias df='df -h'
+ alias indent='indent -bad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -npsl -nsc -nsob -nss -ts4 '
+ #alias bc='bc -l'
+ alias minicom='minicom -c on'
+ alias calc='calc -Cd '
+ alias bc='calc -Cd '
+fi;
+
+# Source configuration files from /etc/profile.d
+for i in /etc/profile.d/*.sh ; do
+ if [ -r "$i" ]; then
+ . $i
+ fi
+done
diff --git a/remote/tools/base/data/etc/systemd/system/network-fast.service b/remote/tools/base/data/etc/systemd/system/network-fast.service
new file mode 100644
index 00000000..6656b189
--- /dev/null
+++ b/remote/tools/base/data/etc/systemd/system/network-fast.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Setup Network Connection
+After=udev.service
+
+[Service]
+ExecPre=/openslx/bin/ip link set dev eth0 up
+ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.default.script -i eth0
+
diff --git a/remote/tools/base/data/etc/udhcpc.default.script b/remote/tools/base/data/etc/udhcpc.default.script
new file mode 100755
index 00000000..09442a5e
--- /dev/null
+++ b/remote/tools/base/data/etc/udhcpc.default.script
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Busybox udhcpc dispatcher script. Copyright (C) 2009 by Axel Beckert.
+#
+# Based on the busybox example scripts and the old udhcp source
+# package default.* scripts.
+
+RESOLV_CONF="/etc/resolv.conf"
+
+case $1 in
+ bound|renew)
+ [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+ [ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+ ip addr add $ip/$(ipcalc -s -p $ip $subnet|sed s/.*=//) dev $interface
+ ip route add default via $router
+
+ # read filename from fbgui.conf where ip config should be saved.
+ ipconf=$(cat /etc/fbgui.conf | grep ip_config | cut -d '=' -f2)
+
+ echo "ip=$ip" > $ipconf
+ echo "subnet=$subnet" >> $ipconf
+ echo "broadcast=$broadcast" >> $ipconf
+ echo "gateway=$router" >> $ipconf
+ echo "$ip:132.230.4.3:$router:$subnet" > /tmp/ip_config_fbgui
+
+ # Update resolver configuration file
+ R=""
+ [ -n "$domain" ] && R="domain $domain
+"
+ count=1;
+ for i in $dns; do
+ echo "$0: Adding DNS $i"
+ R="${R}nameserver $i
+"
+ count=$((count+1));
+ done
+
+ if [ -x /sbin/resolvconf ]; then
+ echo -n "$R" | resolvconf -a "${interface}.udhcpc"
+ else
+ echo -n "$R" > "$RESOLV_CONF"
+ fi
+ trigger=$(cat /etc/fbgui.conf | grep file_trigger | cut -d '=' -f2)
+
+ echo "gogo" >> $trigger
+ ;;
+
+ deconfig)
+
+ ;;
+
+ leasefail)
+ echo "$0: Lease failed: $message"
+ ;;
+
+ nak)
+ echo "$0: Received a NAK: $message"
+ ;;
+
+ *)
+ echo "$0: Unknown udhcpc command: $1";
+ exit 1;
+ ;;
+esac