mirror of
https://github.com/RasppleII/a2server.git
synced 2024-12-23 08:29:50 +00:00
7cf972cc7d
Closes #11 and #13. As mentioned in #11, support for Ubuntu should return in the future, but not explicitly. Rather, the core of A2SERVER itself ashould be made to run on any OS distribution for which our requirements are met. The goal is that any OS-specific details should be part of OS-specific packaging or handled by the user (editing MOTD/issue files, etc.) We can handle those details on Debian systems because we know how to do that when packaging for Debian. Ubuntu, Fedora, etc. packages will have to make their own tweaks. This commit doesn't do all of that, but it does mean there's one fewer things we need to worry about during the transition.
28 lines
1.2 KiB
Bash
Executable File
28 lines
1.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
|
|
|
|
# This script helps when running on the Linux console within a VirtualBox VM.
|
|
|
|
echo
|
|
|
|
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
|
|
[[ $userPw == "$(echo 'apple2' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isApple2Pw=1 || isApple2Pw=
|
|
[[ $userPw == "$(echo 'raspberry' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isRaspberryPw=1 || isRaspberryPw=
|
|
|
|
password="your password"
|
|
[[ $isApple2Pw ]] && password="'apple2'"
|
|
[[ $isRaspberryPw ]] && password="'raspberry'"
|
|
|
|
isDebian=
|
|
[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1
|
|
|
|
if [[ $isDebian ]]; then
|
|
if { lspci 2> /dev/null | grep -q VirtualBox; }; then
|
|
echo "A2SERVER: Disabling VirtualBox console screen blanking..."
|
|
sudo sed -i 's/^BLANK_DPMS=off/BLANK_DPMS=on/' /etc/kbd/config
|
|
sudo sed -i 's/^BLANK_TIME=[^0].$/BLANK_TIME=0/' /etc/kbd/config
|
|
sudo /etc/init.d/kbd restart &> /dev/null
|
|
sudo /etc/init.d/console-setup restart &> /dev/null
|
|
fi
|
|
fi
|