2015-10-09 12:29:32 +00:00
|
|
|
#! /bin/bash
|
2016-10-25 19:09:52 +00:00
|
|
|
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
|
2015-10-03 12:25:44 +00:00
|
|
|
|
2015-11-17 13:36:22 +00:00
|
|
|
# This script helps when running on the Linux console within a VirtualBox VM.
|
2015-10-03 12:25:44 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
|
2016-10-27 07:55:16 +00:00
|
|
|
isApple2Pw=
|
|
|
|
if [[ $userPw == "$(echo 'apple2' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]]; then
|
|
|
|
isApple2Pw=1
|
|
|
|
fi
|
|
|
|
isRaspberryPw=
|
|
|
|
if [[ $userPw == "$(echo 'raspberry' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]]; then
|
|
|
|
isRaspberryPw=1
|
|
|
|
fi
|
2015-10-03 12:25:44 +00:00
|
|
|
|
|
|
|
password="your password"
|
|
|
|
[[ $isApple2Pw ]] && password="'apple2'"
|
|
|
|
[[ $isRaspberryPw ]] && password="'raspberry'"
|
|
|
|
|
2016-10-27 15:17:31 +00:00
|
|
|
if [[ "$(lsb_release -ds)" = Debian* ]]; then
|
|
|
|
if [[ "$debianVersion" -ge 7 || $debianVersion == [a-z]* ]]; then
|
2016-10-27 07:55:16 +00:00
|
|
|
isDebian=1
|
|
|
|
fi
|
|
|
|
fi
|
2015-10-03 12:25:44 +00:00
|
|
|
|
|
|
|
if [[ $isDebian ]]; then
|
2016-10-27 07:55:16 +00:00
|
|
|
if lspci 2>/dev/null | grep -q VirtualBox; then
|
2016-10-25 19:09:52 +00:00
|
|
|
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
|
2015-10-03 12:25:44 +00:00
|
|
|
fi
|