Permalink
Browse files

WIP: work on easier syntax

  • Loading branch information...
1 parent 1cfacda commit da9fce707cb13913e825a7c8a1a62708dfc639d5 @jcdubacq committed Mar 6, 2013
View
@@ -37,22 +37,28 @@ runit() {
TOPDIR="$INSTALL/lib/$BASEDIR"
if [ -f "$TOPDIR"/README ]; then COMMENT=$(cat "$TOPDIR"/README); else COMMENT="Adding modification $1"; fi
chapter "$1: $COMMENT"
- for i in $TOPDIR/*; do
+ find $TOPDIR -print | while read i; do
ii="${i#$TOPDIR/}"
- j=$(echo "$ii"|sed -e 's/%_\([^_]\)/\/\1/g;s/%_\(_*\)/\1/g;s/%\(%*\)/\1/g;s/^\([^\/]\)/\/etc\/\1/g')
- jj=$(dirname "$j")
+ if [ "${ii#_}" != "$ii" ]; then
+ j="/root/${ii#_}"
+ else
+ j="/etc/${ii}"
+ fi
+ jj=$(dirname "$ii")
+ POSTRUN=0
+ POSTREVERT=0
case "$ii" in
VERSION|README)
true
;;
- *.debconf)
- if [ "$REVERT" = 0 ]; then debconf-set-selections < "$i"; fi
+ POSTRUN)
+ if [ "$REVERT" = 0 ]; then FILE="$j"; export FILE; POSTRUN=1; fi
;;
- *.run)
- if [ "$REVERT" = 0 ]; then FILE="$j"; export FILE; sh "$i"; fi
+ POSTREVERT)
+ if [ "$REVERT" = 1 ]; then FILE="$j"; export FILE; POSTREVERT=1; fi
;;
- *.revert)
- if [ "$REVERT" = 1 ]; then FILE="$j"; export FILE; sh "$i"; fi
+ *.debconf)
+ if [ "$REVERT" = 0 ]; then debconf-set-selections < "$i"; fi
;;
*.patch)
if [ "$REVERT" = 1 ]; then OPTION=-R;else OPTION=-N;fi
@@ -71,6 +77,12 @@ runit() {
;;
esac
done
+ if [ "$POSTRUN" = 1 ]; then
+ sh "${TOPDIR}/POSTRUN"
+ fi
+ if [ "$POSTREVERT" = 1 ]; then
+ sh "${TOPDIR}/POSTREVERT"
+ fi
shift
etckeeper commit "$COMMENT"||true
}
@@ -79,23 +91,24 @@ runit() {
if [ "$REVERT" = 0 ]; then
chapter "Checking basic packages"
- apt-get install debconf-utils
- apt-get install gnome
- apt-get install texlive-full
- apt-get install vim
- apt-get --purge remove nano
+ ${APT} install debconf-utils
+ ${APT} install autossh
+ ${APT} install gnome
+ ${APT} install texlive-full
+ ${APT} install vim
+ ${APT} --purge remove nano
chapter "Initializing /etc monitoring"
- apt-get install etckeeper
+ ${APT} install etckeeper
rm -rf /etc/.git
etckeeper init
etckeeper commit "Initial commit"
runit record-manual
runit network
+ runit repository-dubacq
+ runit repository-sidexp
runit superusers
runit fix-groups
runit postfix
- runit repository-dubacq
- runit repository-sidexp
fi
if [ "$REVERT" = 1 ]; then
runit network
Binary file not shown.
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCXgdI6WInY7avlwq7BN6vR1vTmXE2veRc9dga5TLDQgJeyDaW4TY9oE/pEMef6f/TBWs71miHLPpUujWhdBB8T4487Z4FPrmHytMznc2rFAY0zF3mofKFMssx4AF18JW+v1yLu5ezgocZcraTg2rLvM2gSrtEq3qiywXEDC44ZxB4nnYhUYHFR5TGVX4NbqF1eaLPIA8k9BS+nGO8Y9xvBXmJ5yWZuHKEQDtax9jL3voaonndhzfr8kbeqwbJ7j6ePmVy9FC7zE389fuFEW1ru1Inh3D+V+fwik2j0MrmLBiAQ1DDyMSfenTkYGX4zhz4ReED8Zu4Lh7Vhi+3KLEC1 root@merlin
@@ -1,4 +1,4 @@
#!/bin/sh
invoke-rc.d postfix stop || true
-$APT --purge remove postfix
+$APT --purge remove postfix autossh
$APT --purge autoremove
@@ -3,5 +3,5 @@ for i in /etc/postfix/main.cf /etc/postfix/generic; do
perl -pi -e 's/__HOST__/'${HOSTINSTALL}'/g' "$i"
done
etckeeper commit "Preseed postfix configuration"
-$APT install postfix
+$APT install postfix autossh
invoke-rc.d postfix reload

0 comments on commit da9fce7

Please sign in to comment.