2021-07-12 20:37:34 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ "$EUID" -ne 0 ]
|
|
|
|
then echo "Please run as root"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
LOCALIP=$(hostname -I)
|
|
|
|
|
2021-10-19 10:36:36 -04:00
|
|
|
source .passwd.cfg
|
|
|
|
|
|
|
|
[ -d "webdir" ] && echo "Old config found. Removing." && rm -r webdir
|
2021-07-13 08:35:52 -04:00
|
|
|
|
|
|
|
#copy the pre-preseed file and update the passwords from the .passwd.cfg file
|
2021-07-13 08:43:38 -04:00
|
|
|
mkdir webdir
|
2021-07-13 08:41:49 -04:00
|
|
|
cp input.cfg webdir/preseed.cfg
|
|
|
|
sed -i "s/@ROOTHASH/$roothash/g" webdir/preseed.cfg
|
|
|
|
sed -i "s/@USERHASH/$userhash/g" webdir/preseed.cfg
|
2021-07-13 08:35:52 -04:00
|
|
|
|
2021-07-12 20:37:34 -04:00
|
|
|
echo "Starting server. Press CTRL+C to stop."
|
|
|
|
echo -e "Local IP address: \e[32m$LOCALIP\e[0m"
|
|
|
|
|
2021-07-13 08:41:49 -04:00
|
|
|
python3 -m http.server 80 --directory ./webdir
|