summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-07-27 07:12:18 +0200
committerKarel Kočí <cynerd@email.cz>2020-07-27 07:12:18 +0200
commitfde2d6a978c9fdfbb0f4d2cbcffe583e6351fe04 (patch)
tree5b9919361a1e9b8f328e4ae127f4e0689640328d /templates
parentd50319c7cc48abb8465a245d01b69859bbe719d8 (diff)
downloadlaminar-cnf-fde2d6a978c9fdfbb0f4d2cbcffe583e6351fe04.tar.gz
laminar-cnf-fde2d6a978c9fdfbb0f4d2cbcffe583e6351fe04.tar.bz2
laminar-cnf-fde2d6a978c9fdfbb0f4d2cbcffe583e6351fe04.zip
Replace scp with sftp
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/alpine.run12
-rwxr-xr-xtemplates/turris.run12
2 files changed, 13 insertions, 11 deletions
diff --git a/templates/alpine.run b/templates/alpine.run
index e21958a..7ebec51 100755
--- a/templates/alpine.run
+++ b/templates/alpine.run
@@ -68,10 +68,12 @@ uroot cp "$FILES/alpine/abuild.conf" "$ROOT/etc/abuild.conf"
uchroot build 'buildrepo --purge --keep-going personal'
echo_stage "Deploy"
-ssh upload rm -rf "deploy-alpine"
-scp -r "$WORKSPACE/packages/personal/$ARCH" upload:"deploy-alpine-$ARCH"
-ssh upload /bin/sh -e <<EOF
- rm -rf "/var/www/repo/alpine/$ARCH"
+sftp -b - upload <<EOF
+ !rm -rf "deploy-alpine-$ARCH"
+ put "$WORKSPACE/packages/personal/$ARCH" "deploy-alpine-$ARCH"
+ !rm -rf "/var/www/repo/alpine/$ARCH"
mv "deploy-alpine-$ARCH" "/var/www/repo/alpine/$ARCH"
+
+ put "$FILES"/alpine/setup.sh /var/www/repo/alpine/
+ put "$FILES"/alpine/setup.sh.gpg /var/www/repo/alpine/
EOF
-scp "$FILES"/alpine/setup.sh{,.gpg} upload:/var/www/repo/alpine/
diff --git a/templates/turris.run b/templates/turris.run
index 98d489f..9392eee 100755
--- a/templates/turris.run
+++ b/templates/turris.run
@@ -63,10 +63,10 @@ echo_stage "Generate index and sign"
$make package/index BUILD_KEY=~/openwrt-repo.sec
echo_stage "Deploy"
-ssh upload rm -rf "deploy-turris-$ANIMAL-$BOARD"
-scp -r "bin/packages/$ARCH/personal" upload:deploy-turris-$ANIMAL-$BOARD
-ssh upload /bin/sh -e <<EOF
- mkdir -p "/var/www/repo/turris/$ANIMAL"
- rm -rf "/var/www/repo/turris/$ANIMAL/$BOARD"
- mv deploy-turris-$ANIMAL-$BOARD "/var/www/repo/turris/$ANIMAL/$BOARD"
+sftp -d - upload <<EOF
+ !rm -rf "deploy-turris-$ANIMAL-$BOARD"
+ put "bin/packages/$ARCH/personal" "deploy-turris-$ANIMAL-$BOARD"
+ !mkdir -p "/var/www/repo/turris/$ANIMAL"
+ !rm -rf "/var/www/repo/turris/$ANIMAL/$BOARD"
+ mv "deploy-turris-$ANIMAL-$BOARD" "/var/www/repo/turris/$ANIMAL/$BOARD"
EOF