Created
February 5, 2013 13:55
-
-
Save ipoddubny/4714593 to your computer and use it in GitHub Desktop.
Asking user for confirmation from RedHat kickstart pre-installation script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%pre --interpreter /usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os, sys | |
from snack import * | |
def set_tty(n): | |
f = open('/dev/tty%d' % n, 'a') | |
os.dup2(f.fileno(), sys.stdin.fileno()) | |
os.dup2(f.fileno(), sys.stdout.fileno()) | |
os.dup2(f.fileno(), sys.stderr.fileno()) | |
set_tty(1) | |
screen = SnackScreen() | |
def CheckCancel(ret): | |
if ret == 'cancel': | |
screen.finish(); | |
os.execlp("reboot",""); | |
sys.exit(0); | |
x = ButtonChoiceWindow(screen, "Installer", "Press Ok to proceed...") | |
CheckCancel(x) | |
screen.finish() | |
set_tty(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment