Commit 8e5f1b96 authored by plaasio's avatar plaasio 👷🏽

Add new file

parent 97e51da7
Pipeline #173 canceled with stages
#!/bin/bash
set -e
read -p "enter PNV username: " -r
unm=$REPLY
echo $unm > /etc/hostname
sed -r -i"" "s/localhost( jubilinux)?$/localhost $unm/" /etc/hosts
sed -r -i"" "s/127.0.1.1.*$/127.0.1.1 $unm/" /etc/hosts
# if passwords are old, force them to be changed at next login
passwd -S edison 2>/dev/null | grep 20[01][0-6] && passwd -e root
# automatically expire edison account if its password is not changed in 3 days
passwd -S edison 2>/dev/null | grep 20[01][0-6] && passwd -e edison -i 3
if [ -e /run/sshwarn ] ; then
echo Please select a secure password for ssh logins to your rig:
echo 'For the "root" account:'
passwd root
echo 'And for the "pi" account (same password is fine):'
passwd pi
fi
grep "PermitRootLogin yes" /etc/ssh/sshd_config || echo "PermitRootLogin yes" > /etc/ssh/sshd_config
# set timezone
dpkg-reconfigure tzdata
#Workarounds for Jubilinux v0.2.0 (Debian Jessie) migration to LTS
if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /dev/null; then
#Disable validity check for archived Debian repos
echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
#Replace apt sources.list with new archive.debian.org locations
echo -e "deb http://security.debian.org/ jessie/updates main\n#deb-src http://security.debian.org/ jessie/updates main\n\ndeb http://archive.debian.org/debian/ jessie-backports main\n#deb-src http://archive.debian.org/debian/ jessie-backports main\n\ndeb http://archive.debian.org/debian/ jessie main contrib non-free\n#deb-src http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list
fi
#Workaround for Jubilinux to install nodejs/npm from nodesource
if getent passwd edison &> /dev/null; then
#Use nodesource setup script to add nodesource repository to sources.list.d
curl -sL https://deb.nodesource.com/setup_8.x | bash -
fi
#dpkg -P nodejs nodejs-dev
# TODO: remove the `-o Acquire::ForceIPv4=true` once Debian's mirrors work reliably over IPv6
apt-get -o Acquire::ForceIPv4=true update && apt-get -o Acquire::ForceIPv4=true -y dist-upgrade && apt-get -o Acquire::ForceIPv4=true -y autoremove
apt-get -o Acquire::ForceIPv4=true update && apt-get -o Acquire::ForceIPv4=true install -y sudo strace tcpdump screen acpid vim python-pip locate ntpdate
#check if edison user exists before trying to add it to groups
if getent passwd edison > /dev/null; then
echo "Adding edison to sudo users"
adduser edison sudo
echo "Adding edison to dialout users"
adduser edison dialout
# else
# echo "User edison does not exist. Apparently, you are runnning a non-edison setup."
fi
sed -i "s/daily/hourly/g" /etc/logrotate.conf
sed -i "s/#compress/compress/g" /etc/logrotate.conf
curl -s https://raw.githubusercontent.com/openaps/oref0/master/bin/openaps-packages.sh | bash -
mkdir -p ~/src; cd ~/src && git clone git://github.com/openaps/oref0.git || (cd oref0 && git checkout master && git pull)
echo "Press Enter to run oref0-setup with the current release (master branch) of oref0,"
read -p "or press ctrl-c to cancel. " -r
cd && ~/src/oref0/bin/oref0-setup.sh
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment