summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2012-12-19 15:43:22 +0100
committerMartin Sivak <msivak@redhat.com>2012-12-19 15:43:22 +0100
commitfec77ff6e27c77e0efe182b734e49ef6288cf258 (patch)
tree72ee23fb42d983c3bbe9c219c845e4193b520121 /scripts
parent6f81a6070930a6c91810e05f5746fc11e2c3c3f5 (diff)
downloadfirstboot2-fec77ff6e27c77e0efe182b734e49ef6288cf258.tar.gz
firstboot2-fec77ff6e27c77e0efe182b734e49ef6288cf258.tar.xz
firstboot2-fec77ff6e27c77e0efe182b734e49ef6288cf258.zip
Use the updated API to get firstboot enabled spokes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/inital-setup.csh19
-rw-r--r--scripts/inital-setup.sh21
2 files changed, 40 insertions, 0 deletions
diff --git a/scripts/inital-setup.csh b/scripts/inital-setup.csh
new file mode 100644
index 0000000..07a4ab7
--- /dev/null
+++ b/scripts/inital-setup.csh
@@ -0,0 +1,19 @@
+# firstboot.csh
+
+set FIRSTBOOT_EXEC = /usr/sbin/firstboot
+set FIRSTBOOT_CONF = /etc/sysconfig/firstboot
+
+# check if we should run firstboot
+grep -i "RUN_FIRSTBOOT=NO" $FIRSTBOOT_CONF >/dev/null
+if (( $? != 0 ) && ( -x $FIRSTBOOT_EXEC )) then
+ # check if we're not on 3270 terminal and root
+ if (( `/sbin/consoletype` == "pty" ) && ( `/usr/bin/id -u` == 0 )) then
+ set args = ""
+ grep -i "reconfig" /proc/cmdline >/dev/null
+ if (( $? == 0 ) || ( -e /etc/reconfigSys )) then
+ set args = "--reconfig"
+ endif
+
+ $FIRSTBOOT_EXEC $args
+ endif
+endif
diff --git a/scripts/inital-setup.sh b/scripts/inital-setup.sh
new file mode 100644
index 0000000..5b4ec9d
--- /dev/null
+++ b/scripts/inital-setup.sh
@@ -0,0 +1,21 @@
+# firstboot.sh
+
+FIRSTBOOT_EXEC=/usr/sbin/firstboot
+FIRSTBOOT_CONF=/etc/sysconfig/firstboot
+
+# source the config file
+[ -f $FIRSTBOOT_CONF ] && . $FIRSTBOOT_CONF
+
+# check if we should run firstboot
+if [ -f $FIRSTBOOT_EXEC ] && [ "${RUN_FIRSTBOOT,,}" = "yes" ]; then
+ # check if we're not on 3270 terminal and root
+ if [ $(/sbin/consoletype) = "pty" ] && [ $EUID -eq 0 ]; then
+ args=""
+ if grep -i "reconfig" /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then
+ args="--reconfig"
+ fi
+
+ . /etc/sysconfig/i18n
+ $FIRSTBOOT_EXEC $args
+ fi
+fi