-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
177 lines (140 loc) · 5.26 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/bin/bash
#Are you root?
if [ "$EUID" -ne 0 ];
then echo "Please run sudo"
exit
else
#Check if there's a dir, if there is; I will create a dir and copy files, if not skip.
echo -e "This installer will wget (download) an install disc/IE4 and add a few shortcuts inside your system. \n\
these shortcuts are found in /usr/bin/ and they can be modifed by entering /usr/share/win95/
These shortcuts are named aptly as win95nokvm (winstartnokvm.sh),win95kvm (winstartkvm.sh),win95cpu (cpu patch, w95cpu.sh),inst95 (start.sh) and uninst95. \n\
In short; would you like to continue this install of a virtual machine of windows 95 or a potential upgrade to 98 SE? \n\
Proceed with the install?"
fi
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "Ok let's get started.."; break;;
No ) echo "Goodbye."; exit;;
esac
done
if [ -d /usr/share/qemu/ ]; then
echo "install found skipping"
elif [[ -f /usr/bin/pacman ]]; then
echo "This is an arch system, will install with pacman" &&
sudo pacman -Syyu && sudo pacman -S qemu-full
else
[[ ! -f /usr/bin/pacman ]]
fi
if [ -d /usr/share/qemu/ ]; then
2> /dev/null
elif [[ -f /usr/bin/dnf ]]; then
echo "This system appears to be redhat based; will install with DNF." &&
sudo dnf update && sudo dnf install qemu
else
[[ ! -f /usr/bin/dnf ]]
fi
if [ -d /usr/share/qemu/ ]; then
2> /dev/null
elif [[ -f /usr/bin/apt ]]; then
echo "This system appears to be debian/ubuntu based; will install with apt." &&
sudo apt update && sudo apt upgrade && sudo apt install qemu-system
fi
if [ ! -d /usr/share/win95 ]; then
mkdir /usr/share/win95 2> /dev/null && chmod +x ./*.sh && cp ./* -u /usr/share/win95/
fi
if [ ! -f /usr/bin/win95nokvm ]; then
echo "Creating shortcuts in for no KVM 95" && ln -sf /usr/share/win95/winstartnokvm.sh /usr/bin/win95nokvm
else
[ -f /usr/bin/win95nokvm ]
fi
#end
if [ ! -f /usr/bin/win95kvm ]; then
echo "Creating KVM shortcuts for win 95" && ln -sf /usr/share/win95/winstartkvm.sh /usr/bin/win95kvm
else
[ -f /usr/bin/win95kvm ]
fi
#end
if [ ! -f /usr/bin/uninst95 ]; then
echo "Creating the uninstall terminal shortcut." && ln -sf /usr/share/win95/uninst95.sh /usr/bin/uninst95
else
[ -f /usr/bin/uninst95 ]
fi
#end
if [ ! -f /usr/bin/inst95 ]; then
echo "Creating the install windows 95 shortcut for the terminal." && ln -sf /usr/share/win95/start.sh /usr/bin/inst95
else
[ -f /usr/bin/inst95 ]
fi
if [ ! -f /usr/bin/win95cpu ]; then
echo "Creating the win95 cpu patch shotcut for KVM." && ln -sf /usr/share/win95/w95cpu.sh /usr/bin/win95cpu
else
[ -f /usr/bin/win95cpu ]
fi
#Yo dawg where's the install disk? if it's here I'll see if the disc is downloaded anyway...
if [ -f /usr/share/win95/ie95.iso ] || [ ! -f /usr/share/win95/ie95.iso ]; then
echo "want to download IE-95?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "grabbing ie 95" &&
wget -c 'https://archive.org/download/ie4-win95-winnt/Internet%20Explorer%204.0%20for%20Windows%2095%20and%20NT%204.0.iso' -O /usr/share/win95/ie95.iso; break;;
No ) mkisofs -o /usr/share/win95/ie95.iso /dev/null 2> /dev/null ; break;;
esac
done
fi
#else if doesn't work, try elif, no doesn't work... hmmm, else works.. NOT
# [ ! -f /usr/share/win95/instdisc.iso ]
#Will create the new drive.
if [ ! -f /var/lib/libvirt/images/win95.qcow2 ]; then
wget -c 'https://archive.org/download/microsoft-windows95-osr2/windows95osr2.iso' -O /usr/share/win95/instdisc.iso &&
#mkisofs -o /usr/share/win95/windows95osr2.iso /dev/null &&
qemu-img create -f qcow2 /var/lib/libvirt/images/win95.qcow2 2G &&
chmod a+rwX /var/lib/libvirt/images/win95.qcow2 |&
cat /usr/share/win95/key.txt &&
/usr/share/win95/win95.sh 2> /dev/null &&
/usr/share/win95/win95.sh 2> /dev/null &&
/usr/share/win95/winstartnokvm.sh 2> /dev/null
else [ -f /var/lib/libvirt/images/win95.qcow2 ]
echo "Win95 HDD exists, format virtual drive?"
select yn in "Yes" "No"; do
case $yn in
Yes ) qemu-img create -f qcow2 /var/lib/libvirt/images/win95.qcow2 2G &&
chmod a+rwX /var/lib/libvirt/images/win95.qcow2 |&
cat /usr/share/win95/key.txt &
/usr/share/win95/win95.sh 2> /dev/null &&
/usr/share/win95/win95.sh 2> /dev/null &&
/usr/share/win95/winstartnokvm.sh 2> /dev/null; break;;
No ) break;;
esac
done
fi
if [ -f /var/lib/libvirt/images/win95.qcow2 ]; then
echo "Are you trying to continue an install"
select yn in "Yes" "No"; do
case $yn in
Yes ) cat /usr/share/win95/key.txt &
/usr/share/win95/win95.sh 2> /dev/null &&
/usr/share/win95/winstartnokvm.sh 2> /dev/null; break;;
No ) break;;
esac
done
fi
if [ -f /var/lib/libvirt/images/win95.qcow2 ]; then
echo "Would you like to upgrade this machine from 95 to 98 SE?"
select yn in "Yes" "No"; do
case $yn in
Yes ) wget -c 'https://archive.org/download/windows-98-se-upgrade/Windows%2098%20se%20Upgrade.iso' -O /usr/share/win95/win98se.iso &&
touch ./98key.txt |& echo VYK42-6KXD9-2C333-3D898-J97HP > ./98key.txt && cat ./98key.txt && /usr/share/win95/win95-up.sh; break;;
No ) break;;
esac
done
echo "want to install additonal drivers for windows 95?"
select yn in "Yes" "No"; do
case $yn in
Yes ) /usr/share/win95/ie95.sh; break;;
No ) exit;;
esac
done
fi
#fi
#fi
#fi