Skip to content

Commit

Permalink
build: simplify armbian build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed May 17, 2018
1 parent 741e79a commit 9c7c994
Showing 1 changed file with 24 additions and 37 deletions.
61 changes: 24 additions & 37 deletions armbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,39 @@ LINUXFAMILY=$2
BOARD=$3
BUILD_DESKTOP=$4

Main() {
case $RELEASE in
jessie)
# your code here
;;
xenial)
# your code here
;;
stretch)
[[ "$RELEASE" != "stretch" ]] && { echo "Only stretch is supported by NextCloudPi" >&2; exit 1; }

# need sudo access that does not expire during build
chage -d -1 root
# need sudo access that does not expire during build
chage -d -1 root

# indicate that this will be an Armbian image build
touch /.ncp-image
# indicate that this will be an Armbian image build
touch /.ncp-image

# install NCP
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash
# install NCP
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash

# permit root login in SSH
sed -i 's|^PermitRootLogin .*|PermitRootLogin yes|' /etc/ssh/sshd_config
# permit root login in SSH
sed -i 's|^PermitRootLogin .*|PermitRootLogin yes|' /etc/ssh/sshd_config

# force change root password at first login (again)
chage -d 0 root
# force change root password at first login (again)
chage -d 0 root

# cleanup
apt-get autoremove -y
apt-get clean
rm /var/lib/apt/lists/* -r
rm /.ncp-image
# cleanup
apt-get autoremove -y
apt-get clean
rm /var/lib/apt/lists/* -r
rm /.ncp-image

# cleanup all NCP options
source /usr/local/etc/library.sh
cd /usr/local/etc/ncp-config.d/
for script in *.sh; do
cleanup_script $script
done
# cleanup all NCP options
source /usr/local/etc/library.sh
cd /usr/local/etc/ncp-config.d/
for script in *.sh; do
cleanup_script $script
done

# enable randomize passwords
systemctl enable nc-provisioning
# enable randomize passwords
systemctl enable nc-provisioning

;;
esac
} # Main

Main "$@"

# License
#
Expand Down

0 comments on commit 9c7c994

Please sign in to comment.